#[repr(transparent)]pub struct VistrMut<'a, T: 'a, D> { /* private fields */ }
Expand description
Tree visitor that returns a mutable reference to each element in the tree.
Implementations§
source§impl<'a, T: 'a, D> VistrMut<'a, T, D>
impl<'a, T: 'a, D> VistrMut<'a, T, D>
pub fn create_wrap_mut(&mut self) -> VistrMut<'_, T, D>
pub fn as_slice_mut(&mut self) -> &mut [T] ⓘ
pub fn into_slice(self) -> &'a mut [T] ⓘ
Methods from Deref<Target = Vistr<'a, T, D>>§
Trait Implementations§
source§impl<'a, T: 'a> Visitor for VistrMut<'a, T, InOrder>
impl<'a, T: 'a> Visitor for VistrMut<'a, T, InOrder>
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 (root,left,right). Takes advantage of the callstack to do dfs.
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. Read more
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) Read more
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 bfs_iter(self) -> BfsIter<Self> ⓘ
fn bfs_iter(self) -> BfsIter<Self> ⓘ
Provides an iterator that returns each element in bfs order.
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. Read more
fn dfs_inorder_iter(self) -> DfsInOrderIter<Self> ⓘ
source§impl<'a, T: 'a> Visitor for VistrMut<'a, T, PostOrder>
impl<'a, T: 'a> Visitor for VistrMut<'a, T, PostOrder>
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 (root,left,right). Takes advantage of the callstack to do dfs.
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. Read more
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) Read more
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 bfs_iter(self) -> BfsIter<Self> ⓘ
fn bfs_iter(self) -> BfsIter<Self> ⓘ
Provides an iterator that returns each element in bfs order.
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. Read more
fn dfs_inorder_iter(self) -> DfsInOrderIter<Self> ⓘ
source§impl<'a, T: 'a> Visitor for VistrMut<'a, T, PreOrder>
impl<'a, T: 'a> Visitor for VistrMut<'a, T, PreOrder>
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 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
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) Read more
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 bfs_iter(self) -> BfsIter<Self> ⓘ
fn bfs_iter(self) -> BfsIter<Self> ⓘ
Provides an iterator that returns each element in bfs order.
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. Read more