[−][src]Struct smallmap::Map
A small hashtable-like map with byte sized key indecies.
Implementations
impl<K, V> Map<K, V> where
K: Collapse,
[src]
K: Collapse,
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
[src]
pub fn clean(&mut self)
[src]
Remove all empty pages from this instance.
pub fn len(&self) -> usize
[src]
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.
pub fn num_pages(&self) -> usize
[src]
The number of pages currently in this map
pub fn into_pages(self) -> Vec<Page<K, V>>
[src]
Consume the instance, returning all pages.
pub fn pages(&self) -> Pages<'_, K, V>ⓘ
[src]
An iterator over all pages
pub fn pages_mut(&mut self) -> PagesMut<'_, K, V>ⓘ
[src]
A mutable iterator over all pages
pub fn iter(&self) -> Iter<'_, K, V>ⓘ
[src]
An iterator over all elements in the map
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘ
[src]
A mutable iterator over all elements in the map
pub fn new() -> Self
[src]
Create a new empty Map
pub fn with_capacity(pages: usize) -> Self
[src]
Create a new empty Map
with a specific number of pages pre-allocated
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Collapse + Eq,
[src]
K: Borrow<Q>,
Q: Collapse + Eq,
Get a mutable reference of the value corresponding to this key if it is in the map.
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Collapse + Eq,
[src]
K: Borrow<Q>,
Q: Collapse + Eq,
Search the map for entry corresponding to this key
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Collapse + Eq,
[src]
K: Borrow<Q>,
Q: Collapse + Eq,
Get a reference of the value corresponding to this key if it is in the map.
pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Collapse + Eq,
[src]
K: Borrow<Q>,
Q: Collapse + Eq,
Remove the entry corresponding to this key in the map, returning the value if it was present
pub fn insert(&mut self, key: K, value: V) -> Option<V>
[src]
Insert a new key-value entry into this map, returning the pervious value if it was present
Trait Implementations
impl<TKey: Clone, TValue: Clone> Clone for Map<TKey, TValue>
[src]
impl<TKey: Debug, TValue: Debug> Debug for Map<TKey, TValue>
[src]
impl<TKey: Default, TValue: Default> Default for Map<TKey, TValue>
[src]
impl<TKey: Eq, TValue: Eq> Eq for Map<TKey, TValue>
[src]
impl<TKey: Hash, TValue: Hash> Hash for Map<TKey, TValue>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<K: Collapse, V> IntoIterator for Map<K, V>
[src]
type Item = (K, V)
The type of the elements being iterated over.
type IntoIter = IntoIter<K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Consume this map into an iterator over all currently inserted entries
impl<TKey: PartialEq, TValue: PartialEq> PartialEq<Map<TKey, TValue>> for Map<TKey, TValue>
[src]
fn eq(&self, other: &Map<TKey, TValue>) -> bool
[src]
fn ne(&self, other: &Map<TKey, TValue>) -> bool
[src]
impl<TKey, TValue> StructuralEq for Map<TKey, TValue>
[src]
impl<TKey, TValue> StructuralPartialEq for Map<TKey, TValue>
[src]
Auto Trait Implementations
impl<TKey, TValue> RefUnwindSafe for Map<TKey, TValue> where
TKey: RefUnwindSafe,
TValue: RefUnwindSafe,
TKey: RefUnwindSafe,
TValue: RefUnwindSafe,
impl<TKey, TValue> Send for Map<TKey, TValue> where
TKey: Send,
TValue: Send,
TKey: Send,
TValue: Send,
impl<TKey, TValue> Sync for Map<TKey, TValue> where
TKey: Sync,
TValue: Sync,
TKey: Sync,
TValue: Sync,
impl<TKey, TValue> Unpin for Map<TKey, TValue> where
TKey: Unpin,
TValue: Unpin,
TKey: Unpin,
TValue: Unpin,
impl<TKey, TValue> UnwindSafe for Map<TKey, TValue> where
TKey: UnwindSafe,
TValue: UnwindSafe,
TKey: UnwindSafe,
TValue: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Collapse for T where
T: Eq + Hash,
[src]
T: Eq + Hash,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,