pub struct Map<C, F> { /* private fields */ }Expand description
Map iterator adapter
Trait Implementations§
Source§impl<B, C: FixedDepthVisitor, F: Fn(C::Item) -> B + Clone> FixedDepthVisitor for Map<C, F>
impl<B, C: FixedDepthVisitor, F: Fn(C::Item) -> B + Clone> FixedDepthVisitor for Map<C, F>
fn get_height(&self) -> usize
Source§impl<B, C: Visitor, F: Fn(C::Item) -> B + Clone> Visitor for Map<C, F>
impl<B, C: Visitor, F: Fn(C::Item) -> B + Clone> Visitor for Map<C, F>
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 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_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 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<C, F> Freeze for Map<C, F>
impl<C, F> RefUnwindSafe for Map<C, F>where
F: RefUnwindSafe,
C: RefUnwindSafe,
impl<C, F> Send for Map<C, F>
impl<C, F> Sync for Map<C, F>
impl<C, F> Unpin for Map<C, F>
impl<C, F> UnwindSafe for Map<C, F>where
F: UnwindSafe,
C: UnwindSafe,
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