pub struct Map(/* private fields */);Expand description
A map: entries in file order, keys unique. Keys are shared: a decoded document allocates each distinct key once, however many maps have it.
Implementations§
Source§impl Map
impl Map
pub fn new() -> Self
pub fn with_capacity(n: usize) -> Self
pub fn get(&self, key: &str) -> Option<&Value>
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
Sourcepub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
pub fn insert(&mut self, key: impl Into<String>, value: Value) -> Option<Value>
Sets key, in place if it’s there, else at the end; returns the old value.
pub fn remove(&mut self, key: &str) -> Option<Value>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl ExactSizeIterator<Item = (&str, &Value)>
pub fn keys(&self) -> impl ExactSizeIterator<Item = &str>
pub fn retain(&mut self, keep: impl FnMut(&str, &Value) -> bool)
Trait Implementations§
Source§impl IntoIterator for Map
impl IntoIterator for Map
impl StructuralPartialEq for Map
Auto Trait Implementations§
impl Freeze for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnsafeUnpin for Map
impl UnwindSafe for Map
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