Struct microkelvin::BranchMut
source · [−]pub struct BranchMut<'a, C, A, I>(_);
Expand description
Reprents a branch view into a collection.
BranchMut allows you to manipulate the value of the leaf, but disallows manipulating the branch nodes directly, to avoid breaking any datastructure invariants.
Branches are always guaranteed to point at a leaf, and can be dereferenced to the pointed-at leaf.
Implementations
sourceimpl<'a, C, A, I> BranchMut<'a, C, A, I>
impl<'a, C, A, I> BranchMut<'a, C, A, I>
sourcepub fn map_leaf<M>(
self,
closure: for<'b> fn(_: &'b mut C::Leaf) -> &'b mut M
) -> MappedBranchMut<'a, C, A, I, M> where
C: Compound<A, I>,
C::Leaf: Archive,
pub fn map_leaf<M>(
self,
closure: for<'b> fn(_: &'b mut C::Leaf) -> &'b mut M
) -> MappedBranchMut<'a, C, A, I, M> where
C: Compound<A, I>,
C::Leaf: Archive,
Returns a branch that maps the leaf to a specific value. Used in maps for example, to get easy access to the value of the KV-pair
sourcepub fn leaf_mut(&mut self) -> &mut C::Leaf where
C: Compound<A, I> + Clone,
pub fn leaf_mut(&mut self) -> &mut C::Leaf where
C: Compound<A, I> + Clone,
Returns a mutable reference to the leaf pointet to by the branch
sourcepub fn walk<W>(root: &'a mut C, walker: W) -> Option<Self> where
C: Compound<A, I> + Clone,
C::Archived: for<'any> CheckBytes<DefaultValidator<'any>>,
C::Archived: Deserialize<C, StoreRef<I>> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
W: Walker<C, A, I>,
pub fn walk<W>(root: &'a mut C, walker: W) -> Option<Self> where
C: Compound<A, I> + Clone,
C::Archived: for<'any> CheckBytes<DefaultValidator<'any>>,
C::Archived: Deserialize<C, StoreRef<I>> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: Archive,
A: Annotation<C::Leaf>,
W: Walker<C, A, I>,
Performs a tree walk, returning either a valid branch or None if the walk failed.
Trait Implementations
sourceimpl<'a, C, A, I> IntoIterator for BranchMut<'a, C, A, I> where
C: Compound<A, I> + Clone,
C::Leaf: 'a + Archive,
C::Archived: Deserialize<C, StoreRef<I>> + for<'any> CheckBytes<DefaultValidator<'any>>,
A: Annotation<C::Leaf>,
impl<'a, C, A, I> IntoIterator for BranchMut<'a, C, A, I> where
C: Compound<A, I> + Clone,
C::Leaf: 'a + Archive,
C::Archived: Deserialize<C, StoreRef<I>> + for<'any> CheckBytes<DefaultValidator<'any>>,
A: Annotation<C::Leaf>,
Auto Trait Implementations
impl<'a, C, A, I> RefUnwindSafe for BranchMut<'a, C, A, I> where
A: RefUnwindSafe,
C: RefUnwindSafe,
I: RefUnwindSafe,
impl<'a, C, A, I> Send for BranchMut<'a, C, A, I> where
A: Send,
C: Send,
I: Send,
impl<'a, C, A, I> Sync for BranchMut<'a, C, A, I> where
A: Sync,
C: Sync,
I: Sync,
impl<'a, C, A, I> Unpin for BranchMut<'a, C, A, I> where
A: Unpin,
I: Unpin,
impl<'a, C, A, I> !UnwindSafe for BranchMut<'a, C, A, I>
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more