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

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 and supports fast insert(), remove(), and contains().

Complexity

Let n be the number of elements in the set.

Temporal complexity

Operation Best case Average Worst case
new() Θ(1) Θ(1) Θ(1)
insert() Θ(1) Θ(1) Θ(n)
remove() Θ(1) Θ(1) Θ(n)
contains() Θ(1) Θ(1) Θ(n)
size() Θ(1) Θ(1) Θ(1)
clone() Θ(1) Θ(1) Θ(1)
iterator creation Θ(1) Θ(1) Θ(1)
iterator step Θ(1) Θ(1) Θ(1)
iterator full Θ(n) Θ(n) Θ(n)

Implementation details

This is a thin wrapper around a HashTrieMap.

Methods

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

[src]

[src]

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

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Trait Implementations

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Returns the "default value" for a type. Read more

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

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

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

[src]

Formats the value using the given formatter. Read more

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

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

[src]

Creates a value from an iterator. Read more

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