[][src]Struct swim_collections::hash_trie::HashTrieSet

pub struct HashTrieSet<'a, T, H = Murmur3> { /* fields omitted */ }

Hash array mapped trie set.

Methods

impl<T> HashTrieSet<'static, T>[src]

pub fn new() -> HashTrieSet<'static, T>[src]

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

impl<T, H> HashTrieSet<'static, T, H>[src]

pub fn new_hasher(hasher: H) -> HashTrieSet<'static, T, H>[src]

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

impl<'a, T> HashTrieSet<'a, T>[src]

pub fn hold_new(hold: &dyn Hold<'a>) -> HashTrieSet<'a, T>[src]

Constructs a new HashTrieSet 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, T, H> HashTrieSet<'a, T, H>[src]

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

Constructs a new HashTrieSet 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 HashTrieSet contains no leafs.

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

Returns the number of leafs in this HashTrieSet.

Important traits for HashTrieSetIter<'a, T>
pub fn iter(&self) -> HashTrieSetIter<'a, T>[src]

Returns an iterator over the leafs of this HashTrieSet.

impl<'a, T: Eq + Hash, H: BuildHasher> HashTrieSet<'a, T, H>[src]

pub fn contains<U: Borrow<T> + ?Sized>(&self, elem: &U) -> bool[src]

Returns true if this HashTrieSet contains the given elem.

pub fn insert(&mut self, elem: T) -> Result<bool, (T, HoldError)>[src]

Includes a new elem in this HashTrieSet; returns true if the set already contained elem. If the trie's Hold fails to allocate any required new memory, returns the elem along with a HoldError, and leaves the trie in its original state.

pub fn remove<U: Borrow<T> + ?Sized>(
    &mut self,
    elem: &U
) -> Result<bool, HoldError>
[src]

Excludes the given elem from this HashTrieSet; returns true if the set previously contained elem. 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, T: 'a + Debug> Debug for HashTrieSet<'a, T>[src]

impl<'a, T, H> IntoIterator for &'a HashTrieSet<'a, T, H>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = HashTrieSetIter<'a, T>

Which kind of iterator are we turning this into?

impl<'a, T, H> Holder<'a> for HashTrieSet<'a, T, H>[src]

impl<'a, 'b, T, H> Stow<'b, HashTrieSet<'b, T, H>> for HashTrieSet<'a, T, H> where
    T: Stow<'b>,
    H: Stow<'b>, 
[src]

impl<'a, T: Clone, H: Clone> TryClone for HashTrieSet<'a, T, H>[src]

impl<'a, T: Clone, H: Clone> CloneIntoHold<'a, HashTrieSet<'a, T, H>> for HashTrieSet<'a, T, 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, T, H> Send for HashTrieSet<'a, T, H> where
    H: Send,
    T: Send

impl<'a, T, H> Sync for HashTrieSet<'a, T, H> where
    H: Sync,
    T: 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]