pub trait ShapeVisitor {
// Required method
fn enter(&mut self, path: &Path, shape: &'static Shape) -> VisitDecision;
// Provided method
fn leave(&mut self, path: &Path, shape: &'static Shape) { ... }
}Expand description
Visitor trait for shape-only traversal.
Implement this trait to receive callbacks as walk_shape descends through
a Shape tree.
Required Methods§
Sourcefn enter(&mut self, path: &Path, shape: &'static Shape) -> VisitDecision
fn enter(&mut self, path: &Path, shape: &'static Shape) -> VisitDecision
Called when the walker enters a node, before visiting children.
Return a VisitDecision to control whether children are visited.
Provided Methods§
Sourcefn leave(&mut self, path: &Path, shape: &'static Shape)
fn leave(&mut self, path: &Path, shape: &'static Shape)
Called when the walker leaves a node, after visiting children (or
after skipping them if enter returned VisitDecision::SkipChildren).
Not called if enter returned VisitDecision::Stop.