Trait ExprVisitor

Source
pub trait ExprVisitor {
    type Error;

    // Required method
    fn pre_visit(&mut self, plan: &Expr) -> Result<bool, Self::Error>;

    // Provided method
    fn post_visit(&mut self, _plan: &Expr) -> Result<bool, Self::Error> { ... }
}
Expand description

Trait that implements the Visitor pattern for a depth first walk on Expr AST. pre_visit is called before any children are visited, and then post_visit is called after all children have been visited. Only pre_visit is required.

Required Associated Types§

Required Methods§

Source

fn pre_visit(&mut self, plan: &Expr) -> Result<bool, Self::Error>

Called before any children are visited. Return Ok(false) to cut short the recursion (skip traversing and return).

Provided Methods§

Source

fn post_visit(&mut self, _plan: &Expr) -> Result<bool, Self::Error>

Called after all children are visited. Return Ok(false) to cut short the recursion (skip traversing and return).

Implementors§