pub enum TreeNodeRecursion {
Continue,
Jump,
Stop,
}
Expand description
Controls how TreeNode
recursions should proceed.
Variants§
Continue
Continue recursion with the next node.
Jump
In top-down traversals, skip recursing into children but continue with the next node, which actually means pruning of the subtree.
In bottom-up traversals, bypass calling bottom-up closures till the next leaf node.
In combined traversals, if it is the f_down
(pre-order) phase, execution
“jumps” to the next f_up
(post-order) phase by shortcutting its children.
If it is the f_up
(post-order) phase, execution “jumps” to the next f_down
(pre-order) phase by shortcutting its parent nodes until the first parent node
having unvisited children path.
Stop
Stop recursion.
Implementations§
Source§impl TreeNodeRecursion
impl TreeNodeRecursion
Sourcepub fn visit_children<F: FnOnce() -> Result<TreeNodeRecursion>>(
self,
f: F,
) -> Result<TreeNodeRecursion>
pub fn visit_children<F: FnOnce() -> Result<TreeNodeRecursion>>( self, f: F, ) -> Result<TreeNodeRecursion>
Continues visiting nodes with f
depending on the current TreeNodeRecursion
value and the fact that f
is visiting the current node’s children.
Sourcepub fn visit_sibling<F: FnOnce() -> Result<TreeNodeRecursion>>(
self,
f: F,
) -> Result<TreeNodeRecursion>
pub fn visit_sibling<F: FnOnce() -> Result<TreeNodeRecursion>>( self, f: F, ) -> Result<TreeNodeRecursion>
Continues visiting nodes with f
depending on the current TreeNodeRecursion
value and the fact that f
is visiting the current node’s sibling.
Sourcepub fn visit_parent<F: FnOnce() -> Result<TreeNodeRecursion>>(
self,
f: F,
) -> Result<TreeNodeRecursion>
pub fn visit_parent<F: FnOnce() -> Result<TreeNodeRecursion>>( self, f: F, ) -> Result<TreeNodeRecursion>
Continues visiting nodes with f
depending on the current TreeNodeRecursion
value and the fact that f
is visiting the current node’s parent.
Trait Implementations§
Source§impl Clone for TreeNodeRecursion
impl Clone for TreeNodeRecursion
Source§fn clone(&self) -> TreeNodeRecursion
fn clone(&self) -> TreeNodeRecursion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TreeNodeRecursion
impl Debug for TreeNodeRecursion
Source§impl PartialEq for TreeNodeRecursion
impl PartialEq for TreeNodeRecursion
impl Copy for TreeNodeRecursion
impl StructuralPartialEq for TreeNodeRecursion
Auto Trait Implementations§
impl Freeze for TreeNodeRecursion
impl RefUnwindSafe for TreeNodeRecursion
impl Send for TreeNodeRecursion
impl Sync for TreeNodeRecursion
impl Unpin for TreeNodeRecursion
impl UnwindSafe for TreeNodeRecursion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)