pub struct Map<TKey, TValue>(/* private fields */);
Expand description
A small hashtable-like map with byte sized key indecies.
Implementations§
Source§impl<K, V> Map<K, V>where
K: Collapse,
impl<K, V> Map<K, V>where
K: Collapse,
Sourcepub fn entry(&mut self, key: K) -> Entry<'_, K, V>
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
Get an Entry
for the key
that lets you get or insert the value
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of entries currently in this map
This is an iterating count over all slots in all current pages, if possible store it in a temporary instead of re-calling it.
Sourcepub fn into_pages(self) -> Vec<Page<K, V>>
pub fn into_pages(self) -> Vec<Page<K, V>>
Consume the instance, returning all pages.
Sourcepub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>
A mutable iterator over all the values in the map
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
A mutable iterator over all elements in the map
Sourcepub fn with_capacity(pages: usize) -> Self
pub fn with_capacity(pages: usize) -> Self
Create a new empty Map
with a specific number of pages pre-allocated
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Get a mutable reference of the value corresponding to this key if it is in the map.
Sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Search the map for entry corresponding to this key
Sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Get a reference of the value corresponding to this key if it is in the map.
Sourcepub fn remove<Q>(&mut self, key: &Q) -> Option<V>
pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
Remove the entry corresponding to this key in the map, returning the value if it was present
Trait Implementations§
Source§impl<K: Collapse, V> Extend<(K, V)> for Map<K, V>
impl<K: Collapse, V> Extend<(K, V)> for Map<K, V>
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)