Trait TreeVisitor

Source
pub trait TreeVisitor<'a, T>
where T: Display + PartialEq + Clone,
{ // Required methods fn visit(&self, tree: &'a Tree<T>, is_last: bool); fn step_down(&self, is_last: bool); fn step_up(&self); }
Expand description

The TreeVisitor trait is the visitor part of the visitor pattern. Objects which on to get notified about a visited node while a tree structure is traversed this trait should be implemented.

Required Methods§

Source

fn visit(&self, tree: &'a Tree<T>, is_last: bool)

Source

fn step_down(&self, is_last: bool)

Source

fn step_up(&self)

Implementors§

Source§

impl<'a, T> TreeVisitor<'a, T> for TreePrinter
where T: Display + PartialEq + Clone,