[−][src]Struct toolshed::map::Map
A map of keys K
to values V
. The map is built as a pseudo-random
binary tree with hashes of keys used for balancing the tree nodes.
All the nodes of the map are also linked to allow iteration in insertion order.
Methods
impl<'arena, K, V> Map<'arena, K, V>
[src]
impl<'arena, K, V> Map<'arena, K, V>
[src]
ⓘImportant traits for MapIter<'arena, K, V>pub fn iter(&self) -> MapIter<'arena, K, V>
[src]
Get an iterator over key value pairs.
pub fn is_empty(&self) -> bool
[src]
Returns true if the map contains no elements.
pub fn clear(&self)
[src]
Clears the map.
impl<'arena, K, V> Map<'arena, K, V> where
K: Eq + Hash + Copy,
V: Copy,
[src]
K: Eq + Hash + Copy,
V: Copy,
pub fn insert(&self, arena: &'arena Arena, key: K, value: V) -> Option<V>
[src]
Inserts a key-value pair into the map. If the key was previously set, old value is returned.
pub fn get_key(&self, key: K) -> Option<&K>
[src]
Returns the value corresponding to the key.
pub fn get(&self, key: K) -> Option<V>
[src]
Returns the value corresponding to the key.
pub fn contains_key(&self, key: K) -> bool
[src]
Returns true if the map contains a value for the specified key.
Trait Implementations
impl<'arena, K, V> Default for Map<'arena, K, V>
[src]
impl<'arena, K: Clone, V: Clone> Clone for Map<'arena, K, V>
[src]
fn clone(&self) -> Map<'arena, K, V>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, 'b, KA, VA, KB, VB> PartialEq<Map<'b, KB, VB>> for Map<'a, KA, VA> where
(&'a KA, VA): PartialEq<(&'b KB, VB)>,
VA: Copy,
VB: Copy,
[src]
(&'a KA, VA): PartialEq<(&'b KB, VB)>,
VA: Copy,
VB: Copy,
fn eq(&self, other: &Map<'b, KB, VB>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'arena, K, V> From<Map<'arena, K, V>> for BloomMap<'arena, K, V> where
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
[src]
K: Eq + Hash + Copy + AsRef<[u8]>,
V: Copy,
impl<'arena, K, V> From<BloomMap<'arena, K, V>> for Map<'arena, K, V>
[src]
impl<'arena, K: Copy, V: Copy> Copy for Map<'arena, K, V>
[src]
impl<'arena, K, V: Copy> IntoIterator for Map<'arena, K, V>
[src]
type Item = (&'arena K, V)
The type of the elements being iterated over.
type IntoIter = MapIter<'arena, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'arena, K, V> Debug for Map<'arena, K, V> where
K: Debug,
V: Debug + Copy,
[src]
K: Debug,
V: Debug + Copy,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[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> 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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,