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]

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]

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]

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]

Construct a branch given a function returning child offsets

Trait Implementations

impl<'a, C: Debug, A: Debug> Debug for Branch<'a, C, A>[src]

impl<'a, C, A> Deref for Branch<'a, C, A> where
    C: Compound<A>,
    A: Combine<C, A>, 
[src]

type Target = C::Leaf

The resulting type after dereferencing.

impl<'a, C, A> IntoIterator for Branch<'a, C, A> where
    C: Compound<A>,
    A: Combine<C, A>, 
[src]

type Item = Result<&'a C::Leaf, CanonError>

The type of the elements being iterated over.

type IntoIter = BranchIterator<'a, C, A, AllLeaves>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<'a, C, A> !RefUnwindSafe for Branch<'a, C, A>

impl<'a, C, A> !Send for Branch<'a, C, A>

impl<'a, C, A> !Sync for Branch<'a, C, A>

impl<'a, C, A> Unpin for Branch<'a, C, A>

impl<'a, C, A> !UnwindSafe for Branch<'a, C, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.