pub trait OwnedScopeVisitor {
type Break;
Show 18 methods
// Provided methods
fn visit_program(
&mut self,
_program: &Program,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_stmt(
&mut self,
_stmt: &Stmt,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_expr(
&mut self,
_expr: &Expr,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_param(
&mut self,
_param: &Param,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_arg(
&mut self,
_arg: &Arg,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_class_member(
&mut self,
_member: &ClassMember,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_enum_member(
&mut self,
_member: &EnumMember,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_property_hook(
&mut self,
_hook: &PropertyHook,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_type_hint(
&mut self,
_type_hint: &TypeHint,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_attribute(
&mut self,
_attribute: &Attribute,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_catch_clause(
&mut self,
_catch: &CatchClause,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_match_arm(
&mut self,
_arm: &MatchArm,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_closure_use_var(
&mut self,
_var: &ClosureUseVar,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_trait_use(
&mut self,
_trait_use: &TraitUseDecl,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_trait_adaptation(
&mut self,
_adaptation: &TraitAdaptation,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_block(
&mut self,
_block: &Block,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_name(
&mut self,
_name: &Name,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
fn visit_comment(
&mut self,
_comment: &Comment,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break> { ... }
}Expand description
A scope-aware variant of OwnedVisitor.
Every visit method receives an OwnedScope describing the lexical context
at that node. Drive traversal with OwnedScopeWalker.
Required Associated Types§
Sourcetype Break
type Break
Value carried by ControlFlow::Break when a visit stops the walk early; use () to
stop without a result.
Provided Methods§
Sourcefn visit_program(
&mut self,
_program: &Program,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_program( &mut self, _program: &Program, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each program with its enclosing scope.
Sourcefn visit_stmt(
&mut self,
_stmt: &Stmt,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_stmt( &mut self, _stmt: &Stmt, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each statement with its enclosing scope.
Sourcefn visit_expr(
&mut self,
_expr: &Expr,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_expr( &mut self, _expr: &Expr, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each expression with its enclosing scope.
Sourcefn visit_param(
&mut self,
_param: &Param,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_param( &mut self, _param: &Param, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each param with its enclosing scope.
Sourcefn visit_arg(
&mut self,
_arg: &Arg,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_arg( &mut self, _arg: &Arg, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each arg with its enclosing scope.
Sourcefn visit_class_member(
&mut self,
_member: &ClassMember,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_class_member( &mut self, _member: &ClassMember, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each class member with its enclosing scope.
Sourcefn visit_enum_member(
&mut self,
_member: &EnumMember,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_enum_member( &mut self, _member: &EnumMember, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each enum member with its enclosing scope.
Sourcefn visit_property_hook(
&mut self,
_hook: &PropertyHook,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_property_hook( &mut self, _hook: &PropertyHook, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each property hook with its enclosing scope.
Sourcefn visit_type_hint(
&mut self,
_type_hint: &TypeHint,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_type_hint( &mut self, _type_hint: &TypeHint, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each type hint with its enclosing scope.
Sourcefn visit_attribute(
&mut self,
_attribute: &Attribute,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_attribute( &mut self, _attribute: &Attribute, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each attribute with its enclosing scope.
Sourcefn visit_catch_clause(
&mut self,
_catch: &CatchClause,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_catch_clause( &mut self, _catch: &CatchClause, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each catch clause with its enclosing scope.
Sourcefn visit_match_arm(
&mut self,
_arm: &MatchArm,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_match_arm( &mut self, _arm: &MatchArm, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each match arm with its enclosing scope.
Sourcefn visit_closure_use_var(
&mut self,
_var: &ClosureUseVar,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_closure_use_var( &mut self, _var: &ClosureUseVar, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each closure use var with its enclosing scope.
Sourcefn visit_trait_use(
&mut self,
_trait_use: &TraitUseDecl,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_trait_use( &mut self, _trait_use: &TraitUseDecl, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each trait use with its enclosing scope.
Sourcefn visit_trait_adaptation(
&mut self,
_adaptation: &TraitAdaptation,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_trait_adaptation( &mut self, _adaptation: &TraitAdaptation, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each trait adaptation with its enclosing scope.
Sourcefn visit_block(
&mut self,
_block: &Block,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_block( &mut self, _block: &Block, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each block with its enclosing scope.
Sourcefn visit_name(
&mut self,
_name: &Name,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_name( &mut self, _name: &Name, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each name reference with its enclosing scope.
Sourcefn visit_comment(
&mut self,
_comment: &Comment,
_scope: &OwnedScope,
) -> ControlFlow<Self::Break>
fn visit_comment( &mut self, _comment: &Comment, _scope: &OwnedScope, ) -> ControlFlow<Self::Break>
Called for each comment with its enclosing scope.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".