Struct microkelvin::Branch [−][src]
pub struct Branch<'a, C, A>(_);
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
impl<'a, C, A> Branch<'a, C, A> where
C: Compound<A>,
A: Combine<C, A>,
[src]
impl<'a, C, A> Branch<'a, C, A> where
C: Compound<A>,
A: Combine<C, A>,
[src]pub fn depth(&self) -> usize
[src]
Returns the depth of the branch
pub fn levels(&self) -> &[Level<'_, C, A>]
[src]
Returns a slice into the levels of the tree.
pub fn map_leaf<M>(
self,
closure: for<'b> fn(_: &'b C::Leaf) -> &'b M
) -> MappedBranch<'a, C, A, M>
[src]
self,
closure: for<'b> fn(_: &'b C::Leaf) -> &'b M
) -> MappedBranch<'a, C, A, M>
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
pub fn walk<W>(root: &'a C, walker: W) -> Result<Option<Self>, CanonError> where
W: Walker<C, A>,
[src]
W: Walker<C, A>,
Performs a tree walk, returning either a valid branch or None if the walk failed.
pub fn path<P>(root: &'a C, path: P) -> Result<Option<Self>, CanonError> where
P: FnMut() -> usize,
[src]
P: FnMut() -> usize,
Construct a branch given a function returning child offsets
Trait Implementations
impl<'a, C, A> IntoIterator for Branch<'a, C, A> where
C: Compound<A>,
A: Combine<C, A>,
[src]
impl<'a, C, A> IntoIterator for Branch<'a, C, A> where
C: Compound<A>,
A: Combine<C, A>,
[src]Auto Trait Implementations
impl<'a, C, A> !RefUnwindSafe for Branch<'a, C, A>
impl<'a, C, A> !RefUnwindSafe for Branch<'a, C, A>
impl<'a, C, A> !UnwindSafe for Branch<'a, C, A>
impl<'a, C, A> !UnwindSafe for Branch<'a, C, A>