pub struct PropertyKey(/* private fields */);Expand description
A property key: a string, an array index or a symbol. Made by
Runtime::intern_property_key or
from a SymbolRef.
Implementations§
Source§impl PropertyKey
impl PropertyKey
pub fn try_clone(&self) -> Result<Self, RuntimeError>
Sourcepub fn from_js_string(text: JsString) -> Self
pub fn from_js_string(text: JsString) -> Self
The key of the string text (an index when text is one’s
canonical form, as ToPropertyKey reads it).
pub fn index(index: u32) -> Self
pub fn as_symbol(&self) -> Option<&SymbolRef>
Sourcepub fn to_js_string(&self) -> Option<JsString>
pub fn to_js_string(&self) -> Option<JsString>
The key as a string; None for a symbol.
Trait Implementations§
Source§impl Clone for PropertyKey
impl Clone for PropertyKey
Source§impl Debug for PropertyKey
impl Debug for PropertyKey
impl Eq for PropertyKey
Source§impl From<SymbolRef> for PropertyKey
impl From<SymbolRef> for PropertyKey
Source§impl PartialEq for PropertyKey
impl PartialEq for PropertyKey
impl StructuralPartialEq for PropertyKey
Source§impl TryFrom<&SymbolRef> for PropertyKey
impl TryFrom<&SymbolRef> for PropertyKey
Source§type Error = RuntimeError
type Error = RuntimeError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl !RefUnwindSafe for PropertyKey
impl !Send for PropertyKey
impl !Sync for PropertyKey
impl !UnwindSafe for PropertyKey
impl Freeze for PropertyKey
impl Unpin for PropertyKey
impl UnsafeUnpin for PropertyKey
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
Mutably borrows from an owned value. Read more