pub trait OwnedVisitor {
Show 18 methods
// Provided methods
fn visit_program(&mut self, program: &Program) -> ControlFlow<()> { ... }
fn visit_stmt(&mut self, stmt: &Stmt) -> ControlFlow<()> { ... }
fn visit_block(&mut self, block: &Block) -> ControlFlow<()> { ... }
fn visit_expr(&mut self, expr: &Expr) -> ControlFlow<()> { ... }
fn visit_param(&mut self, param: &Param) -> ControlFlow<()> { ... }
fn visit_arg(&mut self, arg: &Arg) -> ControlFlow<()> { ... }
fn visit_class_member(&mut self, member: &ClassMember) -> ControlFlow<()> { ... }
fn visit_enum_member(&mut self, member: &EnumMember) -> ControlFlow<()> { ... }
fn visit_property_hook(&mut self, hook: &PropertyHook) -> ControlFlow<()> { ... }
fn visit_type_hint(&mut self, type_hint: &TypeHint) -> ControlFlow<()> { ... }
fn visit_attribute(&mut self, attribute: &Attribute) -> ControlFlow<()> { ... }
fn visit_catch_clause(&mut self, catch: &CatchClause) -> ControlFlow<()> { ... }
fn visit_match_arm(&mut self, arm: &MatchArm) -> ControlFlow<()> { ... }
fn visit_closure_use_var(&mut self, _var: &ClosureUseVar) -> ControlFlow<()> { ... }
fn visit_trait_use(&mut self, trait_use: &TraitUseDecl) -> ControlFlow<()> { ... }
fn visit_trait_adaptation(
&mut self,
_adaptation: &TraitAdaptation,
) -> ControlFlow<()> { ... }
fn visit_name(&mut self, _name: &Name) -> ControlFlow<()> { ... }
fn visit_comment(&mut self, _comment: &Comment) -> ControlFlow<()> { ... }
}Expand description
Visitor trait for immutable traversal of owned (lifetime-free) AST nodes.
All methods return ControlFlow<()>:
ControlFlow::Continue(())— keep walking.ControlFlow::Break(())— stop the entire traversal immediately.
Default implementations recurse into child nodes, so implementors only need to override the node types they care about.
To skip a subtree, override the method and return Continue(())
without calling the corresponding walk_owned_* function.
Provided Methods§
fn visit_program(&mut self, program: &Program) -> ControlFlow<()>
fn visit_stmt(&mut self, stmt: &Stmt) -> ControlFlow<()>
fn visit_block(&mut self, block: &Block) -> ControlFlow<()>
fn visit_expr(&mut self, expr: &Expr) -> ControlFlow<()>
fn visit_param(&mut self, param: &Param) -> ControlFlow<()>
fn visit_arg(&mut self, arg: &Arg) -> ControlFlow<()>
fn visit_class_member(&mut self, member: &ClassMember) -> ControlFlow<()>
fn visit_enum_member(&mut self, member: &EnumMember) -> ControlFlow<()>
fn visit_property_hook(&mut self, hook: &PropertyHook) -> ControlFlow<()>
fn visit_type_hint(&mut self, type_hint: &TypeHint) -> ControlFlow<()>
fn visit_attribute(&mut self, attribute: &Attribute) -> ControlFlow<()>
fn visit_catch_clause(&mut self, catch: &CatchClause) -> ControlFlow<()>
fn visit_match_arm(&mut self, arm: &MatchArm) -> ControlFlow<()>
fn visit_closure_use_var(&mut self, _var: &ClosureUseVar) -> ControlFlow<()>
fn visit_trait_use(&mut self, trait_use: &TraitUseDecl) -> ControlFlow<()>
fn visit_trait_adaptation( &mut self, _adaptation: &TraitAdaptation, ) -> ControlFlow<()>
fn visit_name(&mut self, _name: &Name) -> ControlFlow<()>
fn visit_comment(&mut self, _comment: &Comment) -> ControlFlow<()>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".