[][src]Struct microkelvin::BranchMut

pub struct BranchMut<'a, C, S, const N: usize>(_)
where
    C: Compound<S>,
    C::Annotation: Annotation<C, S>,
    S: Store
;

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.

The const generic N represents the maximum depth of the branch.

Implementations

impl<'a, C, S, const N: usize> BranchMut<'a, C, S, N> where
    C: Compound<S>,
    C::Annotation: Annotation<C, S>,
    S: Store
[src]

pub fn depth(&self) -> usize[src]

Returns the depth of the branch

pub fn levels(&self) -> &[LevelMut<'_, C, S>][src]

Returns a reference to the levels in the branch

pub fn walk<W: FnMut(WalkMut<'_, C, S>) -> StepMut<'_, C, S>>(
    root: &'a mut C,
    walker: W
) -> Result<Option<Self>, S::Error>
[src]

Performs a tree walk, returning either a valid branch or None if the walk failed.

Trait Implementations

impl<'a, C, S, const N: usize> Deref for BranchMut<'a, C, S, N> where
    C: Compound<S>,
    C::Annotation: Annotation<C, S>,
    S: Store
[src]

type Target = C::Leaf

The resulting type after dereferencing.

impl<'a, C, S, const N: usize> DerefMut for BranchMut<'a, C, S, N> where
    C: Compound<S>,
    C::Annotation: Annotation<C, S>,
    S: Store
[src]

Auto Trait Implementations

impl<'a, C, S, const N: usize> RefUnwindSafe for BranchMut<'a, C, S, N> where
    C: RefUnwindSafe,
    S: RefUnwindSafe
[src]

impl<'a, C, S, const N: usize> Send for BranchMut<'a, C, S, N> where
    C: Send,
    S: Send
[src]

impl<'a, C, S, const N: usize> Sync for BranchMut<'a, C, S, N> where
    C: Sync,
    S: Sync
[src]

impl<'a, C, S, const N: usize> Unpin for BranchMut<'a, C, S, N> where
    C: Unpin,
    S: Unpin
[src]

impl<'a, C, S, const N: usize> !UnwindSafe for BranchMut<'a, C, S, N>[src]

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.