[−][src]Trait rustdoc::formats::renderer::FormatRenderer

pub(crate) trait FormatRenderer: Clone {
    pub(crate) fn init(
        krate: Crate,
        options: RenderOptions,
        render_info: RenderInfo,
        edition: Edition,
        cache: &mut Cache
    ) -> Result<(Self, Crate), Error>;
pub(crate) fn item(
        &mut self,
        item: Item,
        cache: &Cache
    ) -> Result<(), Error>;
pub(crate) fn mod_item_in(
        &mut self,
        item: &Item,
        item_name: &str,
        cache: &Cache
    ) -> Result<(), Error>;
pub(crate) fn mod_item_out(&mut self, item_name: &str) -> Result<(), Error>;
pub(crate) fn after_krate(
        &mut self,
        krate: &Crate,
        cache: &Cache
    ) -> Result<(), Error>;
pub(crate) fn after_run(&mut self, diag: &Handler) -> Result<(), Error>; }

Allows for different backends to rustdoc to be used with the run_format() function. Each backend renderer has hooks for initialization, documenting an item, entering and exiting a module, and cleanup/finalizing output.

Required methods

pub(crate) fn init(
    krate: Crate,
    options: RenderOptions,
    render_info: RenderInfo,
    edition: Edition,
    cache: &mut Cache
) -> Result<(Self, Crate), Error>
[src]

Sets up any state required for the renderer. When this is called the cache has already been populated.

pub(crate) fn item(&mut self, item: Item, cache: &Cache) -> Result<(), Error>[src]

Renders a single non-module item. This means no recursive sub-item rendering is required.

pub(crate) fn mod_item_in(
    &mut self,
    item: &Item,
    item_name: &str,
    cache: &Cache
) -> Result<(), Error>
[src]

Renders a module (should not handle recursing into children).

pub(crate) fn mod_item_out(&mut self, item_name: &str) -> Result<(), Error>[src]

Runs after recursively rendering all sub-items of a module.

pub(crate) fn after_krate(
    &mut self,
    krate: &Crate,
    cache: &Cache
) -> Result<(), Error>
[src]

Post processing hook for cleanup and dumping output to files.

pub(crate) fn after_run(&mut self, diag: &Handler) -> Result<(), Error>[src]

Called after everything else to write out errors.

Loading content...

Implementors

impl FormatRenderer for Context[src]

Generates the documentation for crate into the directory dst

impl FormatRenderer for JsonRenderer[src]

Loading content...