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
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
Returns a mutable reference to the leaf pointet to by the branch
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>,
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
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>,
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> !UnwindSafe for BranchMut<'a, C, A, I>
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
Gets the layout of the type.