Struct broccoli_tree::node::VistrMutPin
source · [−]#[repr(transparent)]pub struct VistrMutPin<'a, N> { /* private fields */ }
Expand description
Tree Iterator that returns a protected mutable reference to each node.
Implementations
sourceimpl<'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
sourceimpl<'a, N> FixedDepthVisitor for VistrMutPin<'a, N>
impl<'a, N> FixedDepthVisitor for VistrMutPin<'a, N>
fn get_height(&self) -> usize
sourceimpl<'a, N> Visitor for VistrMutPin<'a, N>
impl<'a, N> Visitor for VistrMutPin<'a, N>
sourcefn 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. Read more
sourcefn 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) Read more
sourcefn 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. Read more
sourcefn 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.
sourcefn map<B, F>(self, func: F) -> Map<Self, F> where
F: Fn(Self::Item) -> B,
fn map<B, F>(self, func: F) -> Map<Self, F> where
F: Fn(Self::Item) -> B,
Map iterator adapter
sourcefn 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. Read more
fn dfs_inorder_iter(self) -> DfsInOrderIter<Self>
sourcefn 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. Read more
sourcefn 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. Read more
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more