pub struct HashTrieSet<T, P = RcK, H = RandomState>{ /* private fields */ }Expand description
A persistent set with structural sharing. This implementation uses a hash array mapped trie.
§Complexity
Let n be the number of elements in the set.
§Temporal complexity
| Operation | Average | Worst case |
|---|---|---|
new() | Θ(1) | Θ(1) |
insert() | Θ(1) | Θ(n) |
remove() | Θ(1) | Θ(n) |
get() | Θ(1) | Θ(n) |
contains() | Θ(1) | Θ(n) |
size() | Θ(1) | Θ(1) |
clone() | Θ(1) | Θ(1) |
| iterator creation | Θ(1) | Θ(1) |
| iterator step | Θ(1) | Θ(1) |
| iterator full | Θ(n) | Θ(n) |
§Implementation details
This is a thin wrapper around a HashTrieMap.
Implementations§
Source§impl<T> HashTrieSet<T, RcK, RandomState>
impl<T> HashTrieSet<T, RcK, RandomState>
pub fn new() -> HashTrieSet<T>
pub fn new_with_degree(degree: u8) -> HashTrieSet<T>
Source§impl<T> HashTrieSet<T, ArcTK>
impl<T> HashTrieSet<T, ArcTK>
pub fn new_sync() -> HashTrieSetSync<T>
pub fn new_with_degree_sync(degree: u8) -> HashTrieSetSync<T>
Source§impl<T, P, H> HashTrieSet<T, P, H>
impl<T, P, H> HashTrieSet<T, P, H>
pub fn new_with_hasher_with_ptr_kind(hasher_builder: H) -> HashTrieSet<T, P, H>
pub fn new_with_hasher_and_degree_and_ptr_kind( hasher_builder: H, degree: u8, ) -> HashTrieSet<T, P, H>
pub fn insert(&self, v: T) -> HashTrieSet<T, P, H>
pub fn insert_mut(&mut self, v: T)
pub fn remove<V>(&self, v: &V) -> HashTrieSet<T, P, H>
pub fn remove_mut<V>(&mut self, v: &V) -> bool
pub fn get<V>(&self, v: &V) -> Option<&T>
pub fn contains<V>(&self, v: &V) -> bool
pub fn is_disjoint<HO: BuildHasher + Clone>( &self, other: &HashTrieSet<T, P, HO>, ) -> bool
pub fn is_subset<HO: BuildHasher + Clone>( &self, other: &HashTrieSet<T, P, HO>, ) -> bool
pub fn is_superset<HO: BuildHasher + Clone>( &self, other: &HashTrieSet<T, P, HO>, ) -> bool
pub fn size(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, T, P>
Trait Implementations§
Source§impl<T, P, H> Clone for HashTrieSet<T, P, H>
impl<T, P, H> Clone for HashTrieSet<T, P, H>
Source§fn clone(&self) -> HashTrieSet<T, P, H>
fn clone(&self) -> HashTrieSet<T, P, H>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, P, H> Debug for HashTrieSet<T, P, H>
impl<T, P, H> Debug for HashTrieSet<T, P, H>
Source§impl<T, P, H> Default for HashTrieSet<T, P, H>
impl<T, P, H> Default for HashTrieSet<T, P, H>
Source§fn default() -> HashTrieSet<T, P, H>
fn default() -> HashTrieSet<T, P, H>
Returns the “default value” for a type. Read more
Source§impl<T, P, H> Display for HashTrieSet<T, P, H>
impl<T, P, H> Display for HashTrieSet<T, P, H>
Source§impl<T, P, H> FromIterator<T> for HashTrieSet<T, P, H>
impl<T, P, H> FromIterator<T> for HashTrieSet<T, P, H>
Source§fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> HashTrieSet<T, P, H>
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> HashTrieSet<T, P, H>
Creates a value from an iterator. Read more
Source§impl<'a, T, P, H> IntoIterator for &'a HashTrieSet<T, P, H>
impl<'a, T, P, H> IntoIterator for &'a HashTrieSet<T, P, H>
Source§impl<T, P, PO, H> PartialEq<HashTrieSet<T, PO, H>> for HashTrieSet<T, P, H>
impl<T, P, PO, H> PartialEq<HashTrieSet<T, PO, H>> for HashTrieSet<T, P, H>
impl<T, P, H> Eq for HashTrieSet<T, P, H>
Auto Trait Implementations§
impl<T, P, H> Freeze for HashTrieSet<T, P, H>
impl<T, P, H> RefUnwindSafe for HashTrieSet<T, P, H>
impl<T, P, H> Send for HashTrieSet<T, P, H>
impl<T, P, H> Sync for HashTrieSet<T, P, H>
impl<T, P, H> Unpin for HashTrieSet<T, P, H>where
H: Unpin,
impl<T, P, H> UnwindSafe for HashTrieSet<T, P, H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more