pub struct Hamt<K, V, A>(/* private fields */)
where
A: Annotation<KvPair<K, V>>;Implementations§
Source§impl<K, V, A> Hamt<K, V, A>
impl<K, V, A> Hamt<K, V, A>
pub fn insert(&mut self, key: K, val: V) -> Result<Option<V>, CanonError>
pub fn remove(&mut self, key: &K) -> Result<Option<V>, CanonError>
pub fn get<'a>( &'a self, key: &K, ) -> Result<Option<impl Deref<Target = V> + 'a>, CanonError>
pub fn get_mut<'a>( &'a mut self, key: &K, ) -> Result<Option<impl DerefMut<Target = V> + 'a>, CanonError>
Trait Implementations§
Source§impl<K, V, A> Compound<A> for Hamt<K, V, A>
impl<K, V, A> Compound<A> for Hamt<K, V, A>
Source§fn child(&self, ofs: usize) -> Child<'_, Self, A>
fn child(&self, ofs: usize) -> Child<'_, Self, A>
Returns a reference to a possible child at specified offset
Source§fn child_mut(&mut self, ofs: usize) -> ChildMut<'_, Self, A>
fn child_mut(&mut self, ofs: usize) -> ChildMut<'_, Self, A>
Returns a mutable reference to a possible child at specified offset
Source§fn from_generic(generic: &GenericTree) -> Result<Self, CanonError>
fn from_generic(generic: &GenericTree) -> Result<Self, CanonError>
Construct a specific compound tree from a generic tree
Source§fn annotations(&self) -> AnnoIter<'_, Self, A>where
A: Annotation<Self::Leaf>,
fn annotations(&self) -> AnnoIter<'_, Self, A>where
A: Annotation<Self::Leaf>,
Provides an iterator over all sub-annotations of the compound node
Source§fn generic(&self) -> GenericTree
fn generic(&self) -> GenericTree
Returns a generic version of this compound tree, erasing the specific
annotation and leaf types, to provide a universal tree encoding.
Auto Trait Implementations§
impl<K, V, A> !Freeze for Hamt<K, V, A>
impl<K, V, A> !RefUnwindSafe for Hamt<K, V, A>
impl<K, V, A> Send for Hamt<K, V, A>
impl<K, V, A> Sync for Hamt<K, V, A>
impl<K, V, A> Unpin for Hamt<K, V, A>
impl<K, V, A> !UnwindSafe for Hamt<K, V, A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EncodeToVec for Twhere
T: Canon,
impl<T> EncodeToVec for Twhere
T: Canon,
Source§impl<'a, C, A> First<'a, A> for C
impl<'a, C, A> First<'a, A> for C
Source§fn first(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
fn first(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a
Branch pointing to the first element, if not emptySource§fn first_mut(&'a mut self) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves + Clone,
fn first_mut(&'a mut self) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves + Clone,
Construct a
BranchMut pointing to the first element, if not emptySource§impl<'a, C, A, K> GetMaxKey<'a, A, K> for C
impl<'a, C, A, K> GetMaxKey<'a, A, K> for C
Source§fn max_key(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
fn max_key(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a
Branch pointing to the element with the largest keySource§fn max_key_mut(&'a mut self) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves,
fn max_key_mut(&'a mut self) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves,
Construct a
BranchMut pointing to the element with the largest keySource§impl<'a, C, A> Nth<'a, A> for C
impl<'a, C, A> Nth<'a, A> for C
Source§fn nth(&'a self, ofs: u64) -> Result<Option<Branch<'a, C, A>>, CanonError>
fn nth(&'a self, ofs: u64) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a
Branch pointing to the nth element, if anySource§fn nth_mut(
&'a mut self,
ofs: u64,
) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves,
fn nth_mut(
&'a mut self,
ofs: u64,
) -> Result<Option<BranchMut<'a, C, A>>, CanonError>where
C: MutableLeaves,
Construct a
BranchMut pointing to the nth element, if any