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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl DocVisitor<'_> for LocalSourcesCollector<'_, '_>

source§

impl DocVisitor<'_> for SourceCollector<'_, '_>

source§

impl<'a, 'b> DocVisitor<'_> for CoverageCalculator<'a, 'b>

source§

impl<'a, 'tcx> DocVisitor<'_> for DocTestVisibilityLinter<'a, 'tcx>

source§

impl<'a, 'tcx> DocVisitor<'_> for LinkCollector<'a, 'tcx>

source§

impl<'a, 'tcx> DocVisitor<'_> for SyntheticImplCollector<'a, 'tcx>

source§

impl<'a, 'tcx> DocVisitor<'_> for Linter<'a, 'tcx>

source§

impl<'cache> DocVisitor<'_> for ItemAndAliasCollector<'cache>

source§

impl<'cx, 'cache, 'item> DocVisitor<'item> for TypeImplCollector<'cx, 'cache, 'item>