[][src]Struct rpds::set::hash_trie_set::HashTrieSet

pub struct HashTrieSet<T, H: BuildHasher = RandomState> where
    T: Eq + Hash,
    H: Clone
{ /* fields omitted */ }

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)
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.

Methods

impl<T> HashTrieSet<T, RandomState> where
    T: Eq + Hash
[src]

#[must_use]
pub fn new() -> HashTrieSet<T>
[src]

pub fn new_with_degree(degree: u8) -> HashTrieSet<T>[src]

impl<T, H: BuildHasher> HashTrieSet<T, H> where
    T: Eq + Hash,
    H: Clone
[src]

pub fn new_with_hasher(hasher_builder: H) -> HashTrieSet<T, H>[src]

pub fn new_with_hasher_and_degree(
    hasher_builder: H,
    degree: u8
) -> HashTrieSet<T, H>
[src]

#[must_use]
pub fn insert(&self, v: T) -> HashTrieSet<T, H>
[src]

pub fn insert_mut(&mut self, v: T)[src]

#[must_use]
pub fn remove<V: ?Sized>(&self, v: &V) -> HashTrieSet<T, H> where
    T: Borrow<V>,
    V: Hash + Eq
[src]

pub fn remove_mut<V: ?Sized>(&mut self, v: &V) -> bool where
    T: Borrow<V>,
    V: Hash + Eq
[src]

#[must_use]
pub fn contains<V: ?Sized>(&self, v: &V) -> bool where
    T: Borrow<V>,
    V: Hash + Eq
[src]

#[must_use]
pub fn is_disjoint<I: BuildHasher + Clone>(
    &self,
    other: &HashTrieSet<T, I>
) -> bool
[src]

#[must_use]
pub fn is_subset<I: BuildHasher + Clone>(
    &self,
    other: &HashTrieSet<T, I>
) -> bool
[src]

#[must_use]
pub fn is_superset<I: BuildHasher + Clone>(
    &self,
    other: &HashTrieSet<T, I>
) -> bool
[src]

#[must_use]
pub fn size(&self) -> usize
[src]

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

#[must_use]
pub fn iter(&self) -> Iter<T>
[src]

Trait Implementations

impl<T, H: BuildHasher> Default for HashTrieSet<T, H> where
    T: Eq + Hash,
    H: Default + Clone
[src]

impl<T, H: BuildHasher> Clone for HashTrieSet<T, H> where
    T: Eq + Hash,
    H: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a, T, H: BuildHasher> IntoIterator for &'a HashTrieSet<T, H> where
    T: Eq + Hash,
    H: Default + Clone
[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

impl<T: Eq, H: BuildHasher> Eq for HashTrieSet<T, H> where
    T: Hash,
    H: Clone
[src]

impl<T: Eq, H: BuildHasher> PartialEq<HashTrieSet<T, H>> for HashTrieSet<T, H> where
    T: Hash,
    H: Clone
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<T, H: BuildHasher> Display for HashTrieSet<T, H> where
    T: Eq + Hash + Display,
    H: Clone
[src]

impl<T, H> FromIterator<T> for HashTrieSet<T, H> where
    T: Eq + Hash,
    H: BuildHasher + Clone + Default
[src]

impl<T: Debug, H: Debug + BuildHasher> Debug for HashTrieSet<T, H> where
    T: Eq + Hash,
    H: Clone
[src]

impl<T, H> Serialize for HashTrieSet<T, H> where
    T: Eq + Hash + Serialize,
    H: BuildHasher + Clone + Default
[src]

impl<'de, T, H> Deserialize<'de> for HashTrieSet<T, H> where
    T: Eq + Hash + Deserialize<'de>,
    H: BuildHasher + Clone + Default
[src]

Auto Trait Implementations

impl<T, H> Send for HashTrieSet<T, H> where
    H: Send,
    T: Send + Sync

impl<T, H> Sync for HashTrieSet<T, H> where
    H: Sync,
    T: Send + Sync

Blanket Implementations

impl<T> From for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]