Module visitor

Source
Expand description

Defines two overrideable visitor traits that can be used to conveniently traverse the whole contents of an item. This is useful when e.g. dealing with types, which show up pretty much everywhere in the ast.

The crate defines two traits:

Structs§

AstVisitableWrapper
Implementation detail: wrapper that implements Visit[Mut]<T> for T: #trait_name, and delegates all the visiting to our trait’s drive[_mut]. Used in the implementation of visit_inner
BodyVisitableWrapper
Implementation detail: wrapper that implements Visit[Mut]<T> for T: #trait_name, and delegates all the visiting to our trait’s drive[_mut]. Used in the implementation of visit_inner
DynVisitor
Ast and body visitor that uses dynamic dispatch to call the provided function on the visited values of the right type.

Traits§

AstVisitable
An overrideable visitor trait that can be used to conveniently traverse the whole contents of an item. This is useful when e.g. dealing with types, which show up pretty much everywhere in the ast.
BodyVisitable
A smaller visitor group just for function bodies. This explores statements, places and operands, but does not recurse into types.
VisitAst
VisitAstMut
VisitBody
VisitBodyMut