rustdoc::visit

Trait DocVisitor

Source
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§

Source

fn visit_item(&mut self, item: &'a Item)

Source

fn visit_inner_recur(&mut self, kind: &'a ItemKind)

Don’t override!

Source

fn visit_item_recur(&mut self, item: &'a Item)

Don’t override!

Source

fn visit_mod(&mut self, m: &'a Module)

Source

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.

Implementors§