Struct Symbol

#[repr(transparent)]
pub struct Symbol { /* private fields */ }

Implementations

impl Symbol

fn has_instance() -> Symbol

The Symbol.hasInstance well-known symbol is used to determine if a constructor object recognizes an object as its instance. The instanceof operator's behavior can be customized by this symbol.

MDN documentation

impl Symbol

fn iterator() -> Symbol

The Symbol.iterator well-known symbol specifies the default iterator for an object. Used by for...of.

MDN documentation

impl Symbol

fn search() -> Symbol

The Symbol.search well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the String.prototype.search() method.

For more information, see RegExp.prototype[@@search]() and String.prototype.search().

MDN documentation

impl Symbol

fn to_primitive() -> Symbol

The Symbol.toPrimitive is a symbol that specifies a function valued property that is called to convert an object to a corresponding primitive value.

MDN documentation

impl Symbol

fn key_for(sym: &Symbol) -> JsValue

The Symbol.keyFor(sym) method retrieves a shared symbol key from the global symbol registry for the given symbol.

MDN documentation

impl Symbol

fn unscopables() -> Symbol

The Symbol.unscopables well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the with environment bindings of the associated object.

MDN documentation

impl Symbol

fn is_concat_spreadable() -> Symbol

The Symbol.isConcatSpreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the Array.prototype.concat() method.

MDN documentation

impl Symbol

fn match_() -> Symbol

The Symbol.match well-known symbol specifies the matching of a regular expression against a string. This function is called by the String.prototype.match() method.

MDN documentation

impl Symbol

fn species() -> Symbol

The well-known symbol Symbol.species specifies a function-valued property that the constructor function uses to create derived objects.

MDN documentation

impl Symbol

fn to_string_tag() -> Symbol

The Symbol.toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the Object.prototype.toString() method.

MDN documentation

impl Symbol

fn to_string(&self) -> JsString

The toString() method returns a string representing the specified Symbol object.

MDN documentation

impl Symbol

fn value_of(&self) -> Symbol

The valueOf() method returns the primitive value of a Symbol object.

MDN documentation

impl Symbol

fn async_iterator() -> Symbol

The Symbol.asyncIterator well-known symbol specifies the default AsyncIterator for an object. If this property is set on an object, it is an async iterable and can be used in a for await...of loop.

MDN documentation

impl Symbol

fn replace() -> Symbol

The Symbol.replace well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the String.prototype.replace() method.

For more information, see RegExp.prototype[@@replace]() and String.prototype.replace().

MDN documentation

impl Symbol

fn split() -> Symbol

The Symbol.split well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the String.prototype.split() method.

For more information, see RegExp.prototype[@@split]() and String.prototype.split(). MDN documentation

impl Symbol

fn for_(key: &str) -> Symbol

The Symbol.for(key) method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.

MDN documentation

impl Symbol

fn to_js_string(&self) -> JsString

The toString() method returns a string representing the specified Symbol object.

MDN documentation

Trait Implementations

impl AsRef<JsValue> for Symbol

fn as_ref(&self) -> &JsValue

impl AsRef<Symbol> for Symbol

fn as_ref(&self) -> &Symbol

impl Clone for Symbol

fn clone(&self) -> Self

impl Debug for Symbol

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Deref for Symbol

type Target = JsValue;
fn deref(&self) -> &JsValue

impl ErasableGeneric for Symbol

type Repr = JsValue;

impl From<JsValue> for Symbol

fn from(obj: JsValue) -> Self

impl FromWasmAbi for Symbol

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for Symbol where Symbol: JsGeneric,

type JsCanon = Symbol;
fn to_js(self) -> Symbol

impl IntoWasmAbi for Symbol

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for Symbol

fn instanceof(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for Symbol

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = Symbol;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for Symbol

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for Symbol

fn none() -> Self::Abi

impl Promising for Symbol

type Resolution = Symbol;

impl RefFromWasmAbi for Symbol

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<Symbol>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl UpcastFrom<Symbol> for Symbol

impl WasmDescribe for Symbol

fn describe()

Auto Trait Implementations

impl Freeze for Symbol

impl RefUnwindSafe for Symbol

impl Send for Symbol

impl Sync for Symbol

impl Unpin for Symbol

impl UnsafeUnpin for Symbol

impl UnwindSafe for Symbol

Blanket Implementations

impl<P, T> Receiver for Symbol where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Symbol where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Symbol where T: 'static + ?Sized,

impl<T> Borrow<T> for Symbol where T: ?Sized,

impl<T> BorrowMut<T> for Symbol where T: ?Sized,

impl<T> CloneToUninit for Symbol where T: Clone,

impl<T> From<T> for Symbol

impl<T> JsGeneric for Symbol where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Symbol where T: IntoWasmAbi,

impl<T> ToOwned for Symbol where T: Clone,

impl<T> TryFromJsValue for Symbol where T: JsCast,

impl<T> VectorFromWasmAbi for Symbol where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Symbol where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Symbol where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Symbol where U: From<T>,

impl<T, U> TryFrom<U> for Symbol where U: Into<T>,

impl<T, U> TryInto<U> for Symbol where U: TryFrom<T>,