pub struct JavascriptMap { /* private fields */ }Expand description
Insertion-ordered ECMAScript Map using SameValueZero-style scalar keys.
Implementations§
Source§impl JavascriptMap
impl JavascriptMap
Sourcepub fn set(&mut self, key: JavascriptValue, value: JavascriptValue)
pub fn set(&mut self, key: JavascriptValue, value: JavascriptValue)
Insert or replace without changing insertion position.
Sourcepub fn get(&self, key: &JavascriptValue) -> Option<&JavascriptValue>
pub fn get(&self, key: &JavascriptValue) -> Option<&JavascriptValue>
Lookup a value.
Sourcepub fn delete(&mut self, key: &JavascriptValue) -> bool
pub fn delete(&mut self, key: &JavascriptValue) -> bool
Delete a key.
Sourcepub fn entries(
&self,
) -> impl Iterator<Item = (&JavascriptValue, &JavascriptValue)>
pub fn entries( &self, ) -> impl Iterator<Item = (&JavascriptValue, &JavascriptValue)>
Insertion-ordered entries.
Trait Implementations§
Source§impl Clone for JavascriptMap
impl Clone for JavascriptMap
Source§fn clone(&self) -> JavascriptMap
fn clone(&self) -> JavascriptMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JavascriptMap
impl Debug for JavascriptMap
Source§impl Default for JavascriptMap
impl Default for JavascriptMap
Source§fn default() -> JavascriptMap
fn default() -> JavascriptMap
Returns the “default value” for a type. Read more
Source§impl PartialEq for JavascriptMap
impl PartialEq for JavascriptMap
impl StructuralPartialEq for JavascriptMap
Auto Trait Implementations§
impl Freeze for JavascriptMap
impl RefUnwindSafe for JavascriptMap
impl Send for JavascriptMap
impl Sync for JavascriptMap
impl Unpin for JavascriptMap
impl UnsafeUnpin for JavascriptMap
impl UnwindSafe for JavascriptMap
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