Struct hamt_rs::HamtMap
[−]
[src]
pub struct HamtMap<K, V, IS = ShareStore<K, V>, H = StdHasher> { /* fields omitted */ }
Methods
impl<K, V, IS, H> HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
[src]
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
fn new() -> HamtMap<K, V, IS, H>
fn iter<'a>(&'a self) -> HamtMapIterator<'a, K, V, IS, H>
fn find<'a>(&'a self, key: &K) -> Option<&'a V>
fn len(&self) -> usize
fn insert(self, key: K, value: V) -> (HamtMap<K, V, IS, H>, bool)
Inserts a key-value pair into the map. An existing value for a key is replaced by the new value. The first tuple element of the return value is the new map instance representing the map after the insertion. The second tuple element is true if the size of the map was changed by the operation and false otherwise.
fn remove(self, key: &K) -> (HamtMap<K, V, IS, H>, bool)
Removes a key-value pair from the map. The first tuple element of the return value is the new map instance representing the map after the insertion. The second tuple element is true if the size of the map was changed by the operation and false otherwise.
fn plus(self, key: K, val: V) -> HamtMap<K, V, IS, H>
Inserts a key-value pair into the map. Same as insert()
but with a return type that's
better suited to chaining multiple calls together.
fn minus(self, key: &K) -> HamtMap<K, V, IS, H>
Removes a key-value pair from the map. Same as remove()
but with a return type that's
better suited to chaining multiple call together
Trait Implementations
impl<K, V, IS, H> Clone for HamtMap<K, V, IS, H>
[src]
fn clone(&self) -> HamtMap<K, V, IS, H>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<K, V, IS, H> Default for HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
[src]
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
impl<'a, K, V, IS, H> IntoIterator for &'a HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash + 'a,
V: Send + Sync + 'a,
IS: ItemStore<K, V> + 'a,
H: Hasher + Default + 'a,
[src]
K: Eq + Send + Sync + Hash + 'a,
V: Send + Sync + 'a,
IS: ItemStore<K, V> + 'a,
H: Hasher + Default + 'a,
type Item = (&'a K, &'a V)
The type of the elements being iterated over.
type IntoIter = HamtMapIterator<'a, K, V, IS, H>
Which kind of iterator are we turning this into?
fn into_iter(self) -> HamtMapIterator<'a, K, V, IS, H>
Creates an iterator from a value. Read more
impl<K, V, IS, H> PartialEq for HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash,
V: PartialEq + Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
[src]
K: Eq + Send + Sync + Hash,
V: PartialEq + Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
fn eq(&self, other: &HamtMap<K, V, IS, H>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &HamtMap<K, V, IS, H>) -> bool
This method tests for !=
.
impl<K, V, IS, H> Eq for HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash,
V: Eq + Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
[src]
K: Eq + Send + Sync + Hash,
V: Eq + Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
impl<K, V, IS, H> FromIterator<(K, V)> for HamtMap<K, V, IS, H> where
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
[src]
K: Eq + Send + Sync + Hash,
V: Send + Sync,
IS: ItemStore<K, V>,
H: Hasher + Default,
fn from_iter<T>(iterator: T) -> Self where
T: IntoIterator<Item = (K, V)>,
T: IntoIterator<Item = (K, V)>,
Creates a value from an iterator. Read more