pub trait Node: Debug {
// Required methods
fn visit<V: Visit>(&self, visit: V)
where Self: Sized;
fn visit_mut<V: VisitMut>(&mut self, visit: V);
}Expand description
A node in the statement AST that can be traversed by a visitor.
Every AST type (statements, expressions, values, etc.) implements Node
to participate in the visitor pattern defined by Visit and
VisitMut.
§Examples
ⓘ
use toasty_core::stmt::{Node, Expr, Value, visit};
let expr = Expr::from(Value::from(42_i64));
visit::for_each_expr(&expr, |e| {
println!("{:?}", e);
});Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.