pub struct Hamt<K, V, A>(_)
where
A: Annotation<KvPair<K, V>>;
Implementations
sourceimpl<K, V, A> Hamt<K, V, A> where
K: Eq + Canon,
V: Canon,
A: Annotation<KvPair<K, V>> + Canon,
impl<K, V, A> Hamt<K, V, A> where
K: Eq + Canon,
V: Canon,
A: Annotation<KvPair<K, V>> + Canon,
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
sourceimpl<K, V, A> Compound<A> for Hamt<K, V, A> where
A: Annotation<KvPair<K, V>>,
K: Canon,
V: Canon,
A: Canon,
impl<K, V, A> Compound<A> for Hamt<K, V, A> where
A: Annotation<KvPair<K, V>>,
K: Canon,
V: Canon,
A: Canon,
sourcefn 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
sourcefn 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
sourcefn from_generic(generic: &GenericTree) -> Result<Self, CanonError>
fn from_generic(generic: &GenericTree) -> Result<Self, CanonError>
Construct a specific compound tree from a generic tree
sourcefn 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
sourcefn generic(&self) -> GenericTree where
A: Annotation<Self::Leaf>,
Self::Leaf: Canon,
fn generic(&self) -> GenericTree where
A: Annotation<Self::Leaf>,
Self::Leaf: Canon,
Returns a generic version of this compound tree, erasing the specific annotation and leaf types, to provide a universal tree encoding. Read more
Auto Trait Implementations
impl<K, V, A> !RefUnwindSafe for Hamt<K, V, A>
impl<K, V, A> Send for Hamt<K, V, A> where
A: Send + Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V, A> Sync for Hamt<K, V, A> where
A: Send + Sync,
K: Send + Sync,
V: Send + Sync,
impl<K, V, A> Unpin for Hamt<K, V, A> where
A: Unpin,
K: Unpin,
V: Unpin,
impl<K, V, A> !UnwindSafe for Hamt<K, V, A>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> EncodeToVec for T where
T: Canon,
impl<T> EncodeToVec for T where
T: Canon,
sourcepub fn encode_to_vec(&self) -> Vec<u8, Global>
pub fn encode_to_vec(&self) -> Vec<u8, Global>
Encode Self
into a buffer
sourceimpl<'a, C, A> First<'a, A> for C where
C: Compound<A>,
A: Canon,
impl<'a, C, A> First<'a, A> for C where
C: Compound<A>,
A: Canon,
sourcepub fn first(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
pub fn first(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a Branch
pointing to the first element, if not empty
sourcepub fn first_mut(
&'a mut self
) -> Result<Option<BranchMut<'a, C, A>>, CanonError> where
C: MutableLeaves + Clone,
pub 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 empty
sourceimpl<'a, C, A, K> GetMaxKey<'a, A, K> for C where
C: Compound<A> + Clone,
A: Annotation<<C as Compound<A>>::Leaf> + Borrow<MaxKey<K>>,
K: Ord + Clone + Debug,
<C as Compound<A>>::Leaf: Keyed<K>,
impl<'a, C, A, K> GetMaxKey<'a, A, K> for C where
C: Compound<A> + Clone,
A: Annotation<<C as Compound<A>>::Leaf> + Borrow<MaxKey<K>>,
K: Ord + Clone + Debug,
<C as Compound<A>>::Leaf: Keyed<K>,
sourcepub fn max_key(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
pub fn max_key(&'a self) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a Branch
pointing to the element with the largest key
sourcepub fn max_key_mut(
&'a mut self
) -> Result<Option<BranchMut<'a, C, A>>, CanonError> where
C: MutableLeaves,
pub 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 key
sourceimpl<'a, C, A> Nth<'a, A> for C where
C: Compound<A> + Clone,
A: Annotation<<C as Compound<A>>::Leaf> + Borrow<Cardinality>,
impl<'a, C, A> Nth<'a, A> for C where
C: Compound<A> + Clone,
A: Annotation<<C as Compound<A>>::Leaf> + Borrow<Cardinality>,
sourcepub fn nth(&'a self, ofs: u64) -> Result<Option<Branch<'a, C, A>>, CanonError>
pub fn nth(&'a self, ofs: u64) -> Result<Option<Branch<'a, C, A>>, CanonError>
Construct a Branch
pointing to the nth
element, if any
sourcepub fn nth_mut(
&'a mut self,
ofs: u64
) -> Result<Option<BranchMut<'a, C, A>>, CanonError> where
C: MutableLeaves,
pub 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more