pub struct Map<TKey, TValue>(_);Expand description
A small hashtable-like map with byte sized key indecies.
Implementations
sourceimpl<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 pages(&self) -> Pages<'_, K, V>ⓘNotable traits for Pages<'a, K, V>impl<'a, K, V> Iterator for Pages<'a, K, V> type Item = &'a Page<K, V>;
pub fn pages(&self) -> Pages<'_, K, V>ⓘNotable traits for Pages<'a, K, V>impl<'a, K, V> Iterator for Pages<'a, K, V> type Item = &'a Page<K, V>;
An iterator over all pages
sourcepub fn pages_mut(&mut self) -> PagesMut<'_, K, V>ⓘNotable traits for PagesMut<'a, K, V>impl<'a, K, V> Iterator for PagesMut<'a, K, V> type Item = &'a mut Page<K, V>;
pub fn pages_mut(&mut self) -> PagesMut<'_, K, V>ⓘNotable traits for PagesMut<'a, K, V>impl<'a, K, V> Iterator for PagesMut<'a, K, V> type Item = &'a mut Page<K, V>;
A mutable iterator over all pages
sourcepub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K, V> Iterator for Iter<'a, K, V> where
K: Collapse, type Item = &'a (K, V);
pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K, V> Iterator for Iter<'a, K, V> where
K: Collapse, type Item = &'a (K, V);
K: Collapse, type Item = &'a (K, V);
An iterator over all elements in the map
sourcepub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>impl<'a, K, V> Iterator for IterMut<'a, K, V> where
K: Collapse, type Item = &'a mut (K, V);
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>impl<'a, K, V> Iterator for IterMut<'a, K, V> where
K: Collapse, type Item = &'a mut (K, V);
K: Collapse, type Item = &'a mut (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: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Collapse + Eq,
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Collapse + Eq,
Get a mutable reference of the value corresponding to this key if it is in the map.
sourcepub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Collapse + Eq,
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Collapse + Eq,
Search the map for entry corresponding to this key
sourcepub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Collapse + Eq,
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Collapse + Eq,
Get a reference of the value corresponding to this key if it is in the map.
sourcepub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Collapse + Eq,
pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Collapse + Eq,
Remove the entry corresponding to this key in the map, returning the value if it was present
Trait Implementations
sourceimpl<K: Collapse, V> Extend<(K, V)> for Map<K, V>
impl<K: Collapse, V> Extend<(K, V)> for Map<K, V>
sourcefn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<K: Collapse, V> IntoIterator for Map<K, V>
impl<K: Collapse, V> IntoIterator for Map<K, V>
impl<TKey: Eq, TValue: Eq> Eq for Map<TKey, TValue>
impl<TKey, TValue> StructuralEq for Map<TKey, TValue>
impl<TKey, TValue> StructuralPartialEq for Map<TKey, TValue>
Auto Trait Implementations
impl<TKey, TValue> RefUnwindSafe for Map<TKey, TValue> where
TKey: RefUnwindSafe,
TValue: RefUnwindSafe,
impl<TKey, TValue> Send for Map<TKey, TValue> where
TKey: Send,
TValue: Send,
impl<TKey, TValue> Sync for Map<TKey, TValue> where
TKey: Sync,
TValue: Sync,
impl<TKey, TValue> Unpin for Map<TKey, TValue> where
TKey: Unpin,
TValue: Unpin,
impl<TKey, TValue> UnwindSafe for Map<TKey, TValue> where
TKey: UnwindSafe,
TValue: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more