pub(crate) trait DocVisitor<'a>: Sized {
// Provided methods
fn visit_item(&mut self, item: &'a Item) { ... }
fn visit_inner_recur(&mut self, kind: &'a ItemKind) { ... }
fn visit_item_recur(&mut self, item: &'a Item) { ... }
fn visit_mod(&mut self, m: &'a Module) { ... }
fn visit_crate(&mut self, c: &'a Crate) { ... }
}
Expand description
Allows a type to traverse the cleaned ast of a crate.
Note that like rustc_ast::visit::Visitor
, but
unlike rustc_lint::EarlyLintPass
, if you override a
visit_*
method, you will need to manually recurse into
its contents.
Provided Methods§
fn visit_item(&mut self, item: &'a Item)
Sourcefn visit_inner_recur(&mut self, kind: &'a ItemKind)
fn visit_inner_recur(&mut self, kind: &'a ItemKind)
Don’t override!
Sourcefn visit_item_recur(&mut self, item: &'a Item)
fn visit_item_recur(&mut self, item: &'a Item)
Don’t override!
fn visit_mod(&mut self, m: &'a Module)
Sourcefn visit_crate(&mut self, c: &'a Crate)
fn visit_crate(&mut self, c: &'a Crate)
This is the main entrypoint of DocVisitor
.
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.