pub struct AllocBTreeMap<K, V> { /* private fields */ }Expand description
A Map implementation based on alloc::collections::BTreeMap.
Implementations§
Source§impl<K, V> AllocBTreeMap<K, V>
impl<K, V> AllocBTreeMap<K, V>
Sourcepub fn with_btree_map(btree_map: BTreeMap<K, V>) -> Self
pub fn with_btree_map(btree_map: BTreeMap<K, V>) -> Self
Creates a new AllocBTreeMap with the given BTreeMap.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty AllocBTreeMap.
Trait Implementations§
Source§impl<K, V> Default for AllocBTreeMap<K, V>
impl<K, V> Default for AllocBTreeMap<K, V>
Source§impl<K: Ord, V> Map<K, V> for AllocBTreeMap<K, V>
impl<K: Ord, V> Map<K, V> for AllocBTreeMap<K, V>
Source§type Error = Infallible
type Error = Infallible
Associated error type.
Source§fn insert(&mut self, key: K, value: V) -> Result<Option<V>, Self::Error>
fn insert(&mut self, key: K, value: V) -> Result<Option<V>, Self::Error>
Inserts a new key/value pair into this map.
Source§fn get(&self, key: &K) -> Option<&V>
fn get(&self, key: &K) -> Option<&V>
Returns an immutable reference to the value associated with the given key.
Source§fn get_mut(&mut self, key: &K) -> Option<&mut V>
fn get_mut(&mut self, key: &K) -> Option<&mut V>
Returns a mutable reference to the value associated with the given key.
Source§fn remove(&mut self, key: &K) -> Option<V>
fn remove(&mut self, key: &K) -> Option<V>
Removes the key/value pair associated with the given key from this map.
Source§fn clear(&mut self) -> Result<(), Self::Error>
fn clear(&mut self) -> Result<(), Self::Error>
Removes all key/value pairs stored in this map.
Auto Trait Implementations§
impl<K, V> Freeze for AllocBTreeMap<K, V>
impl<K, V> RefUnwindSafe for AllocBTreeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for AllocBTreeMap<K, V>
impl<K, V> Sync for AllocBTreeMap<K, V>
impl<K, V> Unpin for AllocBTreeMap<K, V>
impl<K, V> UnwindSafe for AllocBTreeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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