Struct microkelvin::Branch
source ·
[−]pub struct Branch<'a, C, A, I>(_)
where
C: Archive;
Expand description
Reprents an immutable branch view into a collection.
Branche are always guaranteed to point at a leaf, and can be dereferenced to the pointed-at leaf.
Implementations
pub fn map_leaf<M>(
self,
closure: fn(_: MaybeArchived<'a, C::Leaf>) -> M
) -> MappedBranch<'a, C, A, I, M> where
C: Compound<A, I>,
M: 'a,
pub fn map_leaf<M>(
self,
closure: fn(_: MaybeArchived<'a, C::Leaf>) -> M
) -> MappedBranch<'a, C, A, I, M> where
C: Compound<A, I>,
M: 'a,
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 reference to the currently pointed-at leaf
pub fn walk<W>(root: MaybeArchived<'a, C>, walker: W) -> Option<Self> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + Archive,
A: Annotation<C::Leaf>,
W: Walker<C, A, I>,
pub fn walk<W>(root: MaybeArchived<'a, C>, walker: W) -> Option<Self> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + 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.
pub fn walk_with_store<W>(
root: MaybeArchived<'a, C>,
walker: W,
store: StoreRef<I>
) -> Option<Self> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + Archive,
A: Annotation<C::Leaf>,
W: Walker<C, A, I>,
pub fn walk_with_store<W>(
root: MaybeArchived<'a, C>,
walker: W,
store: StoreRef<I>
) -> Option<Self> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + 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 Branch<'a, C, A, I> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + Archive,
A: Annotation<C::Leaf>,
impl<'a, C, A, I> IntoIterator for Branch<'a, C, A, I> where
C: Compound<A, I>,
C::Archived: ArchivedCompound<C, A, I> + for<'any> CheckBytes<DefaultValidator<'any>>,
C::Leaf: 'a + Archive,
A: Annotation<C::Leaf>,
Auto Trait Implementations
impl<'a, C, A, I> !RefUnwindSafe for Branch<'a, C, A, I>
impl<'a, C, A, I> !UnwindSafe for Branch<'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.