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§

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>