Struct v8::value::Symbol
[−]
[src]
pub struct Symbol(_, _);
A JavaScript symbol (ECMA-262 edition 6)
This is an experimental feature. Use at your own risk.
Methods
impl Symbol
[src]
fn for_name(isolate: &Isolate, name: &String) -> Symbol
Access global symbol registry.
Note that symbols created this way are never collected, so they should only be used for statically fixed properties. Also, there is only one global name space for the names used as keys. To minimize the potential for clashes, use qualified names as keys.
fn for_api_name(isolate: &Isolate, name: &String) -> Symbol
Retrieve a global symbol.
Similar to for_name
, but using a separate registry that is not accessible by (and cannot
clash with) JavaScript code.
fn get_iterator(isolate: &Isolate) -> Symbol
Well-known symbol Symbol.iterator
.
fn get_unscopables(isolate: &Isolate) -> Symbol
Well-known symbol Symbol.unscopables
.
fn get_to_string_tag(isolate: &Isolate) -> Symbol
Well-known symbol Symbol.toStringTag
.
fn get_is_concat_spreadable(isolate: &Isolate) -> Symbol
Well-known symbol Symbol.isConcatSpreadable
.
unsafe fn from_raw(isolate: &Isolate, raw: SymbolRef) -> Symbol
Creates a symbol from a set of raw pointers.
fn as_raw(&self) -> SymbolRef
Returns the underlying raw pointer behind this symbol.
Methods from Deref<Target=Name>
fn get_identity_hash(&self) -> u32
Returns the identity hash for this object.
The current implementation uses an inline property on the object to store the identity hash.
The return value will never be 0. Also, it is not guaranteed to be unique.
fn as_raw(&self) -> NameRef
Returns the underlying raw pointer behind this primitive.
Trait Implementations
impl Debug for Symbol
[src]
impl Deref for Symbol
[src]
type Target = Name
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value
impl Clone for Symbol
[src]
fn clone(&self) -> Symbol
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more