pub enum WellKnownSymbolKey {
Show 15 variants
Iterator,
AsyncIterator,
HasInstance,
IsConcatSpreadable,
Match,
MatchAll,
Replace,
Search,
Split,
Species,
ToPrimitive,
ToStringTag,
Unscopables,
Dispose,
AsyncDispose,
}Expand description
Well-known Symbol property keys used in the iterator protocol.
These are used to represent [Symbol.iterator] and [Symbol.asyncIterator] property names.
Variants§
Iterator
Symbol.iterator - used for sync iterables
AsyncIterator
Symbol.asyncIterator - used for async iterables
HasInstance
Symbol.hasInstance - used for instanceof checks
IsConcatSpreadable
Symbol.isConcatSpreadable - used for array concat behavior
Match
Symbol.match - used for String.match
MatchAll
Symbol.matchAll - used for String.matchAll
Replace
Symbol.replace - used for String.replace
Search
Symbol.search - used for String.search
Split
Symbol.split - used for String.split
Species
Symbol.species - used for derived constructors
ToPrimitive
Symbol.toPrimitive - used for type coercion
ToStringTag
Symbol.toStringTag - used for Object.prototype.toString
Unscopables
Symbol.unscopables - used for with statement
Dispose
Symbol.dispose - used for using declarations
AsyncDispose
Symbol.asyncDispose - used for async using declarations
Implementations§
Source§impl WellKnownSymbolKey
impl WellKnownSymbolKey
Sourcepub const fn as_property_name(&self) -> &'static str
pub const fn as_property_name(&self) -> &'static str
Returns the conventional string property name for this well-known symbol.
This follows the convention of using "[Symbol.iterator]" etc. as property names.
Sourcepub fn from_property_name(name: &str) -> Option<Self>
pub fn from_property_name(name: &str) -> Option<Self>
Parses a property name string into a well-known symbol key.
Returns None if the string is not a well-known symbol property name.
Trait Implementations§
Source§impl Clone for WellKnownSymbolKey
impl Clone for WellKnownSymbolKey
Source§fn clone(&self) -> WellKnownSymbolKey
fn clone(&self) -> WellKnownSymbolKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WellKnownSymbolKey
impl Debug for WellKnownSymbolKey
Source§impl Hash for WellKnownSymbolKey
impl Hash for WellKnownSymbolKey
Source§impl PartialEq for WellKnownSymbolKey
impl PartialEq for WellKnownSymbolKey
impl Copy for WellKnownSymbolKey
impl Eq for WellKnownSymbolKey
impl StructuralPartialEq for WellKnownSymbolKey
Auto Trait Implementations§
impl Freeze for WellKnownSymbolKey
impl RefUnwindSafe for WellKnownSymbolKey
impl Send for WellKnownSymbolKey
impl Sync for WellKnownSymbolKey
impl Unpin for WellKnownSymbolKey
impl UnsafeUnpin for WellKnownSymbolKey
impl UnwindSafe for WellKnownSymbolKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.