Trait Visitor

Source
pub trait Visitor<'a, const N: usize, K> {
    // Required method
    fn visit_node(&mut self, node: &'a Node<N, K>) -> bool;

    // Provided methods
    fn pre_visit_node(&mut self, node: &'a Node<N, K>) -> bool { ... }
    fn post_visit_node(&mut self, node: &'a Node<N, K>) -> bool { ... }
    fn visit_page(&mut self, page: &'a Page<N, K>, high_page: bool) -> bool { ... }
    fn post_visit_page(&mut self, page: &'a Page<N, K>) -> bool { ... }
}
Expand description

An observer of Page and the Node instances within them during tree traversal.

Required Methods§

Source

fn visit_node(&mut self, node: &'a Node<N, K>) -> bool

Visit the given Node.

Provided Methods§

Source

fn pre_visit_node(&mut self, node: &'a Node<N, K>) -> bool

Called before a a call to Visitor::visit_node() with the same Node.

By default this is a no-op unless implemented.

Source

fn post_visit_node(&mut self, node: &'a Node<N, K>) -> bool

Called after Visitor::visit_node() with the same Node.

By default this is a no-op unless implemented.

Source

fn visit_page(&mut self, page: &'a Page<N, K>, high_page: bool) -> bool

Visit the given Page, which was referenced via a high-page link if high_page is true.

By default this is a no-op unless implemented.

Source

fn post_visit_page(&mut self, page: &'a Page<N, K>) -> bool

Called after Visitor::visit_page() with the same Page.

By default this is a no-op unless implemented.

Implementors§

Source§

impl<'a, const N: usize, K> Visitor<'a, N, K> for DotVisitor
where K: Display,