pub trait Visitable<'tree> {
// Required methods
fn children(&self) -> Vec<Node<'tree>>;
fn node(&self) -> Node<'tree>;
// Provided method
fn visit<VisitorT>(
&self,
visitor: VisitorT,
) -> Result<bool, VisitorT::Error>
where VisitorT: Visitor<'tree> { ... }
}
Expand description
Walk-specific trait adding the ability to traverse the KCL AST.
This trait is implemented on Node to handle the fairly tricky bit of recursing into the AST in a single place, as well as helpers for traversing the tree. for callers to use.
Required Methods§
Provided 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.