pub struct JsMap<V> { /* private fields */ }Expand description
insertion ordered map with the semantics of the javascript Map
Implementations§
Source§impl<V> JsMap<V>
impl<V> JsMap<V>
pub fn new() -> Self
pub fn has(&self, key: &str) -> bool
pub fn get(&self, key: &str) -> Option<&V>
pub fn get_mut(&mut self, key: &str) -> Option<&mut V>
Sourcepub fn set(&mut self, key: impl AsRef<str> + Into<SharedStr>, value: V)
pub fn set(&mut self, key: impl AsRef<str> + Into<SharedStr>, value: V)
set a value: an existing key keeps its position
pub fn delete(&mut self, key: &str) -> bool
pub fn clear(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn keys(&self) -> impl Iterator<Item = &str>
pub fn values(&self) -> impl Iterator<Item = &V>
pub fn iter(&self) -> impl Iterator<Item = (&str, &V)>
Trait Implementations§
Auto Trait Implementations§
impl<V> !Send for JsMap<V>
impl<V> !Sync for JsMap<V>
impl<V> Forget for JsMap<V>
impl<V> Freeze for JsMap<V>
impl<V> Move for JsMap<V>
impl<V> RefUnwindSafe for JsMap<V>
impl<V> Unpin for JsMap<V>
impl<V> UnsafeUnpin for JsMap<V>
impl<V> UnwindSafe for JsMap<V>
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