[][src]Struct swim_collections::hash_trie::HashTrieMap

pub struct HashTrieMap<'a, K, V, H = Murmur3> { /* fields omitted */ }

Hash array mapped trie map.

Methods

impl<K, V> HashTrieMap<'static, K, V>[src]

pub fn new() -> HashTrieMap<'static, K, V>[src]

Constructs a new HashTrieMap that will allocate its data in the global Hold.

impl<K, V, H> HashTrieMap<'static, K, V, H>[src]

pub fn new_hasher(hasher: H) -> HashTrieMap<'static, K, V, H>[src]

Constructs a new HashTrieMap that will allocate its data in the global Hold, and hash its keys using the supplied hasher.

impl<'a, K, V> HashTrieMap<'a, K, V>[src]

pub fn hold_new(hold: &dyn Hold<'a>) -> HashTrieMap<'a, K, V>[src]

Constructs a new HashTrieMap that will allocate its data in Hold. Allocates a zero-sized root block in hold, which typically returns a shared sentinel pointer to the hold, consuming no additional memory.

impl<'a, K, V, H> HashTrieMap<'a, K, V, H>[src]

pub fn hold_new_hasher(
    hold: &dyn Hold<'a>,
    hasher: H
) -> HashTrieMap<'a, K, V, H>
[src]

Constructs a new HashTrieMap that will allocate its data in Hold, and hash its keys using the supplied hasher. Allocates a zero-sized root block in hold, which typically returns a shared sentinel pointer to the hold, consuming no additional memory.

pub fn is_empty(&self) -> bool[src]

Returns true if this HashTrieMap contains no leafs.

pub fn len(&self) -> usize[src]

Returns the number of leafs in this HashTrieMap.

Important traits for HashTrieMapIter<'a, K, V>
pub fn iter(&self) -> HashTrieMapIter<'a, K, V>[src]

Returns an iterator over the leafs of this HashTrieMap.

Important traits for HashTrieMapIterMut<'a, K, V>
pub fn iter_mut(&mut self) -> HashTrieMapIterMut<'a, K, V>[src]

Returns a mutable iterator over the leafs of this HashTrieMap.

Important traits for HashTrieMapKeys<'a, K, V>
pub fn keys(&self) -> HashTrieMapKeys<'a, K, V>[src]

Returns an iterator over the keys of this HashTrieMap.

Important traits for HashTrieMapVals<'a, K, V>
pub fn values(&self) -> HashTrieMapVals<'a, K, V>[src]

Returns an iterator over the values of this HashTrieMap.

Important traits for HashTrieMapValsMut<'a, K, V>
pub fn values_mut(&mut self) -> HashTrieMapValsMut<'a, K, V>[src]

Returns a mutable iterator over the values of this HashTrieMap.

impl<'a, K: Eq + Hash, V, H: BuildHasher> HashTrieMap<'a, K, V, H>[src]

pub fn contains_key<J: Borrow<K> + ?Sized>(&self, key: &J) -> bool[src]

Returns true if this HashTrieMap contains the given key.

pub fn get<J: Borrow<K> + ?Sized>(&self, key: &J) -> Option<&V>[src]

Returns the value associated with the given key, or None if no association exists.

pub fn insert(
    &mut self,
    key: K,
    value: V
) -> Result<Option<V>, (K, V, HoldError)>
[src]

Associates a new value with the given key; returns the previous value associated with the key, if defined. If the trie's Hold fails to allocate any required new memory, returns the key and value, along with a HoldError, and leaves the trie in its original state.

pub fn remove<J: Borrow<K> + ?Sized>(
    &mut self,
    key: &J
) -> Result<Option<V>, HoldError>
[src]

Disassociates the given key; returns the previous value associated with the key, if any. Returns a HoldError, and leaves the trie in its original state, if the trie's Hold fails to allocate any required new memory.

Trait Implementations

impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for HashTrieMap<'a, K, V>[src]

impl<'a, K, V, H> IntoIterator for &'a HashTrieMap<'a, K, V, H>[src]

type Item = (&'a K, &'a V)

The type of the elements being iterated over.

type IntoIter = HashTrieMapIter<'a, K, V>

Which kind of iterator are we turning this into?

impl<'a, K, V, H> IntoIterator for &'a mut HashTrieMap<'a, K, V, H>[src]

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.

type IntoIter = HashTrieMapIterMut<'a, K, V>

Which kind of iterator are we turning this into?

impl<'a, K, V, H> Holder<'a> for HashTrieMap<'a, K, V, H>[src]

impl<'a, 'b, K, V, H> Stow<'b, HashTrieMap<'b, K, V, H>> for HashTrieMap<'a, K, V, H> where
    K: Stow<'b>,
    V: Stow<'b>,
    H: Stow<'b>, 
[src]

impl<'a, K: Clone, V: Clone, H: Clone> TryClone for HashTrieMap<'a, K, V, H>[src]

impl<'a, K: Clone, V: Clone, H: Clone> CloneIntoHold<'a, HashTrieMap<'a, K, V, H>> for HashTrieMap<'a, K, V, H>[src]

default fn clone_into_hold(&self, hold: &dyn Hold<'a>) -> T[src]

Returns a clone of self allocated in hold. Read more

Auto Trait Implementations

impl<'a, K, V, H> Send for HashTrieMap<'a, K, V, H> where
    H: Send,
    K: Send,
    V: Send

impl<'a, K, V, H> Sync for HashTrieMap<'a, K, V, H> where
    H: Sync,
    K: Sync,
    V: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'b, S, T> StowFrom for T where
    S: Stow<'b, T>, 
[src]

default fn stow_from(value: T, hold: &dyn Hold<'b>) -> Self[src]

impl<'b, S, T> StowInto for S where
    T: StowFrom<'b, S>, 
[src]

default fn stow_into(self, hold: &dyn Hold<'b>) -> T[src]