Struct rpds::map::hash_trie_map::HashTrieMap [−][src]
A persistent map with structural sharing. This implementation uses a hash array mapped trie.
Complexity
Let n be the number of elements in the map.
Temporal complexity
Operation | Average | Worst case |
---|---|---|
new() | Θ(1) | Θ(1) |
insert() | Θ(1) | Θ(n) |
remove() | Θ(1) | Θ(n) |
get() | Θ(1) | Θ(n) |
contains_key() | Θ(1) | Θ(n) |
size() | Θ(1) | Θ(1) |
clone() | Θ(1) | Θ(1) |
iterator creation | Θ(1) | Θ(1) |
iterator step | Θ(1) | Θ(1) |
iterator full | Θ(n) | Θ(n) |
Implementation details
This implementation uses a hash array mapped trie. Details can be found in Ideal Hash Trees.
See the Node
documentation for details.
Implementations
impl<K, V> HashTrieMap<K, V> where
K: Eq + Hash,
[src]
K: Eq + Hash,
#[must_use]pub fn new() -> HashTrieMap<K, V>
[src]
#[must_use]pub fn new_with_degree(degree: u8) -> HashTrieMap<K, V>
[src]
impl<K, V> HashTrieMap<K, V, ArcK, H> where
K: Eq + Hash,
[src]
K: Eq + Hash,
#[must_use]pub fn new_sync() -> HashTrieMapSync<K, V>
[src]
#[must_use]pub fn new_sync_with_degree(degree: u8) -> HashTrieMapSync<K, V>
[src]
impl<K, V, P, H: BuildHasher> HashTrieMap<K, V, P, H> where
K: Eq + Hash,
H: Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash,
H: Clone,
P: SharedPointerKind,
#[must_use]pub fn new_with_hasher_and_ptr_kind(
hasher_builder: H
) -> HashTrieMap<K, V, P, H>
[src]
hasher_builder: H
) -> HashTrieMap<K, V, P, H>
#[must_use]pub fn new_with_hasher_and_degree_and_ptr_kind(
hasher_builder: H,
degree: u8
) -> HashTrieMap<K, V, P, H>
[src]
hasher_builder: H,
degree: u8
) -> HashTrieMap<K, V, P, H>
#[must_use]pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
#[must_use]pub fn insert(&self, key: K, value: V) -> HashTrieMap<K, V, P, H>
[src]
pub fn insert_mut(&mut self, key: K, value: V)
[src]
#[must_use]pub fn remove<Q: ?Sized>(&self, key: &Q) -> HashTrieMap<K, V, P, H> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn remove_mut<Q: ?Sized>(&mut self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
#[must_use]pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
#[must_use]pub fn size(&self) -> usize
[src]
#[must_use]pub fn is_empty(&self) -> bool
[src]
#[must_use]pub fn iter(&self) -> Iter<'_, K, V, P>
[src]
#[must_use]pub fn keys(&self) -> IterKeys<'_, K, V, P>
[src]
#[must_use]pub fn values(&self) -> IterValues<'_, K, V, P>
[src]
impl<K, V, P, H: BuildHasher> HashTrieMap<K, V, P, H> where
K: Eq + Hash + Clone,
V: Clone,
H: Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash + Clone,
V: Clone,
H: Clone,
P: SharedPointerKind,
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Trait Implementations
impl<K, V, P, H: BuildHasher> Clone for HashTrieMap<K, V, P, H> where
K: Eq + Hash,
H: Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash,
H: Clone,
P: SharedPointerKind,
fn clone(&self) -> HashTrieMap<K, V, P, H>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K: Debug, V: Debug, P: Debug, H: Debug + BuildHasher> Debug for HashTrieMap<K, V, P, H> where
P: SharedPointerKind,
[src]
P: SharedPointerKind,
impl<K, V, P, H: BuildHasher> Default for HashTrieMap<K, V, P, H> where
K: Eq + Hash,
H: Default + Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash,
H: Default + Clone,
P: SharedPointerKind,
fn default() -> HashTrieMap<K, V, P, H>
[src]
impl<'de, K, V, P, H> Deserialize<'de> for HashTrieMap<K, V, P, H> where
K: Eq + Hash + Deserialize<'de>,
V: Deserialize<'de>,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
[src]
K: Eq + Hash + Deserialize<'de>,
V: Deserialize<'de>,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<HashTrieMap<K, V, P, H>, D::Error>
[src]
deserializer: D
) -> Result<HashTrieMap<K, V, P, H>, D::Error>
impl<K, V, P, H: BuildHasher> Display for HashTrieMap<K, V, P, H> where
K: Eq + Hash + Display,
V: Display,
H: Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash + Display,
V: Display,
H: Clone,
P: SharedPointerKind,
impl<K: Eq, V: Eq, P, H: BuildHasher> Eq for HashTrieMap<K, V, P, H> where
K: Hash,
H: Clone,
P: SharedPointerKind,
[src]
K: Hash,
H: Clone,
P: SharedPointerKind,
impl<K, V, P, H> FromIterator<(K, V)> for HashTrieMap<K, V, P, H> where
K: Eq + Hash,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
[src]
K: Eq + Hash,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
fn from_iter<I: IntoIterator<Item = (K, V)>>(
into_iter: I
) -> HashTrieMap<K, V, P, H>
[src]
into_iter: I
) -> HashTrieMap<K, V, P, H>
impl<'a, K, Q: ?Sized, V, P, H: BuildHasher> Index<&'a Q> for HashTrieMap<K, V, P, H> where
K: Eq + Hash + Borrow<Q>,
Q: Hash + Eq,
H: Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash + Borrow<Q>,
Q: Hash + Eq,
H: Clone,
P: SharedPointerKind,
impl<'a, K, V, P, H: BuildHasher> IntoIterator for &'a HashTrieMap<K, V, P, H> where
K: Eq + Hash,
H: Default + Clone,
P: SharedPointerKind,
[src]
K: Eq + Hash,
H: Default + Clone,
P: SharedPointerKind,
type Item = (&'a K, &'a V)
The type of the elements being iterated over.
type IntoIter = Iter<'a, K, V, P>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, K, V, P>
[src]
impl<K: Eq, V: PartialEq, P, PO, H: BuildHasher> PartialEq<HashTrieMap<K, V, PO, H>> for HashTrieMap<K, V, P, H> where
K: Hash,
H: Clone,
P: SharedPointerKind,
PO: SharedPointerKind,
[src]
K: Hash,
H: Clone,
P: SharedPointerKind,
PO: SharedPointerKind,
fn eq(&self, other: &HashTrieMap<K, V, PO, H>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<K, V, P, H> Serialize for HashTrieMap<K, V, P, H> where
K: Eq + Hash + Serialize,
V: Serialize,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
[src]
K: Eq + Hash + Serialize,
V: Serialize,
H: BuildHasher + Clone + Default,
P: SharedPointerKind,
Auto Trait Implementations
impl<K, V, P, H> RefUnwindSafe for HashTrieMap<K, V, P, H> where
H: RefUnwindSafe,
K: RefUnwindSafe,
P: RefUnwindSafe,
V: RefUnwindSafe,
H: RefUnwindSafe,
K: RefUnwindSafe,
P: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, P, H> Send for HashTrieMap<K, V, P, H> where
H: Send,
K: Send,
P: Send,
V: Send,
H: Send,
K: Send,
P: Send,
V: Send,
impl<K, V, P, H> Sync for HashTrieMap<K, V, P, H> where
H: Sync,
K: Sync,
P: Sync,
V: Sync,
H: Sync,
K: Sync,
P: Sync,
V: Sync,
impl<K, V, P, H> Unpin for HashTrieMap<K, V, P, H> where
H: Unpin,
K: Unpin,
P: Unpin,
V: Unpin,
H: Unpin,
K: Unpin,
P: Unpin,
V: Unpin,
impl<K, V, P, H> UnwindSafe for HashTrieMap<K, V, P, H> where
H: UnwindSafe,
K: UnwindSafe,
P: UnwindSafe,
V: UnwindSafe,
H: UnwindSafe,
K: UnwindSafe,
P: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,