[−][src]Struct swim_collections::hash_trie::HashTrieSet
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]
&mut self,
elem: &U
) -> Result<bool, HoldError>
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?
ⓘImportant traits for HashTrieSetIter<'a, T>fn into_iter(self) -> HashTrieSetIter<'a, T>
[src]
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]
T: Stow<'b>,
H: Stow<'b>,
unsafe fn stow(
src: *mut HashTrieSet<'a, T, H>,
dst: *mut HashTrieSet<'b, T, H>,
hold: &dyn Hold<'b>
) -> Result<(), HoldError>
[src]
src: *mut HashTrieSet<'a, T, H>,
dst: *mut HashTrieSet<'b, T, H>,
hold: &dyn Hold<'b>
) -> Result<(), HoldError>
unsafe fn unstow(
src: *mut HashTrieSet<'a, T, H>,
dst: *mut HashTrieSet<'b, T, H>
)
[src]
src: *mut HashTrieSet<'a, T, H>,
dst: *mut HashTrieSet<'b, T, H>
)
impl<'a, T: Clone, H: Clone> TryClone for HashTrieSet<'a, T, H>
[src]
fn try_clone(&self) -> Result<HashTrieSet<'a, T, H>, HoldError>
[src]
impl<'a, T: Clone, H: Clone> CloneIntoHold<'a, HashTrieSet<'a, T, H>> for HashTrieSet<'a, T, H>
[src]
fn try_clone_into_hold(
&self,
hold: &dyn Hold<'a>
) -> Result<HashTrieSet<'a, T, H>, HoldError>
[src]
&self,
hold: &dyn Hold<'a>
) -> Result<HashTrieSet<'a, T, 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, T, H> Send for HashTrieSet<'a, T, H> where
H: Send,
T: Send,
H: Send,
T: Send,
impl<'a, T, H> Sync for HashTrieSet<'a, T, H> where
H: Sync,
T: Sync,
H: Sync,
T: 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>,