[−][src]Struct swim_collections::hash_trie::HashTrieMap
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]
hold: &dyn Hold<'a>,
hasher: H
) -> HashTrieMap<'a, K, V, H>
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]
&mut self,
key: K,
value: V
) -> Result<Option<V>, (K, V, HoldError)>
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]
&mut self,
key: &J
) -> Result<Option<V>, HoldError>
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?
ⓘImportant traits for HashTrieMapIter<'a, K, V>fn into_iter(self) -> HashTrieMapIter<'a, K, V>
[src]
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?
ⓘImportant traits for HashTrieMapIterMut<'a, K, V>fn into_iter(self) -> HashTrieMapIterMut<'a, K, V>
[src]
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]
K: Stow<'b>,
V: Stow<'b>,
H: Stow<'b>,
unsafe fn stow(
src: *mut HashTrieMap<'a, K, V, H>,
dst: *mut HashTrieMap<'b, K, V, H>,
hold: &dyn Hold<'b>
) -> Result<(), HoldError>
[src]
src: *mut HashTrieMap<'a, K, V, H>,
dst: *mut HashTrieMap<'b, K, V, H>,
hold: &dyn Hold<'b>
) -> Result<(), HoldError>
unsafe fn unstow(
src: *mut HashTrieMap<'a, K, V, H>,
dst: *mut HashTrieMap<'b, K, V, H>
)
[src]
src: *mut HashTrieMap<'a, K, V, H>,
dst: *mut HashTrieMap<'b, K, V, H>
)
impl<'a, K: Clone, V: Clone, H: Clone> TryClone for HashTrieMap<'a, K, V, H>
[src]
fn try_clone(&self) -> Result<HashTrieMap<'a, K, V, H>, HoldError>
[src]
impl<'a, K: Clone, V: Clone, H: Clone> CloneIntoHold<'a, HashTrieMap<'a, K, V, H>> for HashTrieMap<'a, K, V, H>
[src]
fn try_clone_into_hold(
&self,
hold: &dyn Hold<'a>
) -> Result<HashTrieMap<'a, K, V, H>, HoldError>
[src]
&self,
hold: &dyn Hold<'a>
) -> Result<HashTrieMap<'a, K, V, H>, HoldError>
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,
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,
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]
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 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, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<'b, S, T> StowFrom for T where
S: Stow<'b, T>,
[src]
S: Stow<'b, T>,
default fn try_stow_from(
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
[src]
src: S,
hold: &dyn Hold<'b>
) -> Result<T, (S, HoldError)>
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]
T: StowFrom<'b, S>,