Struct rpds::map::hash_trie_map::HashTrieMap [] [src]

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

A persistent map with structural sharing. This implementation uses a hash array mapped trie and supports fast insert(), remove(), and get().

Complexity

Let n be the number of elements in the vector.

Temporal complexity

Operation Best case Average Worst case
new() Θ(1) Θ(1) Θ(1)
insert() Θ(1) Θ(1) Θ(n)
remove() Θ(1) Θ(1) Θ(n)
get() Θ(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)

Space complexity

The space complexity is Θ(n).

Implementation details

This implementation is based on Ideal Hash Trees.

See the Node documentation for details.

Methods

impl<K, V> HashTrieMap<K, V, RandomState> where
    K: Eq + Hash
[src]

[src]

[src]

impl<K, V, H: BuildHasher> HashTrieMap<K, V, H> where
    K: Eq + Hash,
    H: Clone
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Trait Implementations

impl<K: Debug, V: Debug, H: Debug + BuildHasher> Debug for HashTrieMap<K, V, H> where
    K: Eq + Hash,
    H: Clone
[src]

[src]

Formats the value using the given formatter.

impl<'a, K, Q: ?Sized, V, H: BuildHasher> Index<&'a Q> for HashTrieMap<K, V, H> where
    K: Eq + Hash + Borrow<Q>,
    Q: Hash + Eq,
    H: Clone
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<K, V, H: BuildHasher> Clone for HashTrieMap<K, V, H> where
    K: 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<K, V, H: BuildHasher> Default for HashTrieMap<K, V, H> where
    K: Eq + Hash,
    H: Default + Clone
[src]

[src]

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

impl<K: Eq, V: PartialEq, H: BuildHasher> PartialEq for HashTrieMap<K, V, H> where
    K: 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<K: Eq, V: Eq, H: BuildHasher> Eq for HashTrieMap<K, V, H> where
    K: Hash,
    H: Clone
[src]

impl<K, V, H: BuildHasher> Display for HashTrieMap<K, V, H> where
    K: Eq + Hash + Display,
    V: Display,
    H: Clone
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, K, V, H: BuildHasher> IntoIterator for &'a HashTrieMap<K, V, H> where
    K: 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<K, V, H> FromIterator<(K, V)> for HashTrieMap<K, V, H> where
    K: Eq + Hash,
    H: BuildHasher + Clone + Default
[src]

[src]

Creates a value from an iterator. Read more