pub struct Hamt<K, V, H> { /* private fields */ }
Expand description
HAMT with shareable nodes
The structure is immutable from root to leaves, where each node of this structure is also independently shareable, including on different thread.
Implementations§
Source§impl<H: Hasher + Default, K: PartialEq + Eq + Hash, V> Hamt<K, V, H>
impl<H: Hasher + Default, K: PartialEq + Eq + Hash, V> Hamt<K, V, H>
Sourcepub fn mutate_freeze<E, F>(&self, f: F) -> Result<Self, E>
pub fn mutate_freeze<E, F>(&self, f: F) -> Result<Self, E>
Temporary create a mutable HAMT from an immutable one, and apply the callback f to the mutable reference, then thaw into the resulting HAMT
let empty : Hamt<u32, u32, DefaultHasher> = Hamt::new();
let result = reference.freeze(|x| {
x.insert(10, 20)?;
x.insert(20, 30)
}).expect("it works");
Trait Implementations§
Source§impl<H: Default + Hasher, K: Eq + Hash + Clone, V: Clone> FromIterator<(K, V)> for Hamt<K, V, H>
impl<H: Default + Hasher, K: Eq + Hash + Clone, V: Clone> FromIterator<(K, V)> for Hamt<K, V, H>
impl<H: Default + Hasher, K: Eq + Hash, V: Eq> Eq for Hamt<K, V, H>
Auto Trait Implementations§
impl<K, V, H> Freeze for Hamt<K, V, H>
impl<K, V, H> RefUnwindSafe for Hamt<K, V, H>
impl<K, V, H> Send for Hamt<K, V, H>
impl<K, V, H> Sync for Hamt<K, V, H>
impl<K, V, H> Unpin for Hamt<K, V, H>where
H: Unpin,
impl<K, V, H> UnwindSafe for Hamt<K, V, 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