pub trait ExpressionVisitable<Expr> {
// Required methods
fn visit_expressions<F, B>(
&self,
f: &mut F,
order: VisitOrder,
) -> ControlFlow<B>
where F: FnMut(&Expr) -> ControlFlow<B>;
fn visit_expressions_mut<F, B>(
&mut self,
f: &mut F,
order: VisitOrder,
) -> ControlFlow<B>
where F: FnMut(&mut Expr) -> ControlFlow<B>;
// Provided methods
fn pre_visit_expressions_mut<F>(&mut self, f: &mut F)
where F: FnMut(&mut Expr) { ... }
fn post_visit_expressions_mut<F>(&mut self, f: &mut F)
where F: FnMut(&mut Expr) { ... }
}Expand description
A trait to be implemented by an AST node.
The idea is that it calls a callback function on each of the sub-nodes
that are expressions.
The difference to the Children
Required Methods§
fn visit_expressions<F, B>( &self, f: &mut F, order: VisitOrder, ) -> ControlFlow<B>
fn visit_expressions_mut<F, B>( &mut self, f: &mut F, order: VisitOrder, ) -> ControlFlow<B>
Provided Methods§
Sourcefn pre_visit_expressions_mut<F>(&mut self, f: &mut F)
fn pre_visit_expressions_mut<F>(&mut self, f: &mut F)
Traverses the AST and calls f on each Expression in pre-order.
Sourcefn post_visit_expressions_mut<F>(&mut self, f: &mut F)
fn post_visit_expressions_mut<F>(&mut self, f: &mut F)
Traverses the AST and calls f on each Expression in post-order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".