Struct generational_cache::map::impls::alloc_btree_map::AllocBTreeMap
source · 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>
§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> RefUnwindSafe for AllocBTreeMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<K, V> Send for AllocBTreeMap<K, V>where K: Send, V: Send,
impl<K, V> Sync for AllocBTreeMap<K, V>where K: Sync, V: Sync,
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