[−][src]Struct microkelvin::BranchMut
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]
C: Compound<S>,
C::Annotation: Annotation<C, S>,
S: Store,
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]
root: &'a mut C,
walker: W
) -> Result<Option<Self>, S::Error>
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]
C: Compound<S>,
C::Annotation: Annotation<C, S>,
S: Store,
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]
C: Compound<S>,
C::Annotation: Annotation<C, S>,
S: Store,
Auto Trait Implementations
impl<'a, C, S, const N: usize> RefUnwindSafe for BranchMut<'a, C, S, N> where
C: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<'a, C, S, const N: usize> Send for BranchMut<'a, C, S, N> where
C: Send,
S: Send,
C: Send,
S: Send,
impl<'a, C, S, const N: usize> Sync for BranchMut<'a, C, S, N> where
C: Sync,
S: Sync,
C: Sync,
S: Sync,
impl<'a, C, S, const N: usize> Unpin for BranchMut<'a, C, S, N> where
C: Unpin,
S: Unpin,
C: Unpin,
S: Unpin,
impl<'a, C, S, const N: usize> !UnwindSafe for BranchMut<'a, C, S, N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,