pub struct VistrMutPin<'a, N> { /* private fields */ }
Expand description
Tree Iterator that returns a protected mutable reference to each node.
Implementations§
Source§impl<'a, N> VistrMutPin<'a, N>
impl<'a, N> VistrMutPin<'a, N>
Sourcepub fn borrow_mut(&mut self) -> VistrMutPin<'_, N>
pub fn borrow_mut(&mut self) -> VistrMutPin<'_, N>
It is safe to borrow the iterator and then produce mutable references from that as long as by the time the borrow ends, all the produced references also go away.
pub fn borrow(&self) -> Vistr<'_, N>
pub fn get_height(&self) -> usize
pub fn into_slice(self) -> AabbPin<&'a mut [N]>
Trait Implementations§
Source§impl<'a, N> FixedDepthVisitor for VistrMutPin<'a, N>
impl<'a, N> FixedDepthVisitor for VistrMutPin<'a, N>
fn get_height(&self) -> usize
Source§impl<'a, N> Visitor for VistrMutPin<'a, N>
impl<'a, N> Visitor for VistrMutPin<'a, N>
Source§fn next(self) -> (Self::Item, Option<[Self; 2]>)
fn next(self) -> (Self::Item, Option<[Self; 2]>)
Consume this visitor, and produce the element it was pointing to
along with it’s children visitors.
Source§fn level_remaining_hint(&self) -> (usize, Option<usize>)
fn level_remaining_hint(&self) -> (usize, Option<usize>)
Return the levels remaining including the one that will be produced by consuming this iterator.
So if you first made this object from the root for a tree of size 5, it should return 5.
Think of is as height-depth.
This is used to make good allocations when doing dfs and bfs.
Defaults to (0,None)
Source§fn dfs_preorder(self, func: impl FnMut(Self::Item))
fn dfs_preorder(self, func: impl FnMut(Self::Item))
Calls the closure in dfs preorder (root,left,right).
Takes advantage of the callstack to do dfs.
Source§fn with_depth(self, start_depth: Depth) -> LevelIter<Self>
fn with_depth(self, start_depth: Depth) -> LevelIter<Self>
Iterator Adapter to also produce the depth each iteration.
Source§fn dfs_preorder_iter(self) -> DfsPreOrderIter<Self>
fn dfs_preorder_iter(self) -> DfsPreOrderIter<Self>
Provides a dfs preorder iterator. Unlike the callback version,
This one relies on dynamic allocation for its stack.
fn dfs_inorder_iter(self) -> DfsInOrderIter<Self>
Source§fn dfs_inorder(self, func: impl FnMut(Self::Item))
fn dfs_inorder(self, func: impl FnMut(Self::Item))
Calls the closure in dfs preorder (left,right,root).
Takes advantage of the callstack to do dfs.
Source§fn dfs_postorder(self, func: impl FnMut(Self::Item))
fn dfs_postorder(self, func: impl FnMut(Self::Item))
Calls the closure in dfs preorder (left,right,root).
Takes advantage of the callstack to do dfs.
Auto Trait Implementations§
impl<'a, N> Freeze for VistrMutPin<'a, N>
impl<'a, N> RefUnwindSafe for VistrMutPin<'a, N>where
N: RefUnwindSafe,
impl<'a, N> Send for VistrMutPin<'a, N>where
N: Send,
impl<'a, N> Sync for VistrMutPin<'a, N>where
N: Sync,
impl<'a, N> Unpin for VistrMutPin<'a, N>
impl<'a, N> !UnwindSafe for VistrMutPin<'a, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more