Trait rustdoc::formats::renderer::FormatRenderer [−][src]
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
fn descr() -> &'static str[src]
Gives a description of the renderer. Used for performance profiling.
fn init(
krate: Crate,
options: RenderOptions,
edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
Sets up any state required for the renderer. When this is called the cache has already been populated.
fn make_child_renderer(&self) -> Self[src]
Make a new renderer to render a child of the item currently being rendered.
fn item(&mut self, item: Item) -> Result<(), Error>[src]
Renders a single non-module item. This means no recursive sub-item rendering is required.
fn mod_item_in(&mut self, item: &Item, item_name: &str) -> Result<(), Error>[src]
Renders a module (should not handle recursing into children).
fn mod_item_out(&mut self, item_name: &str) -> Result<(), Error>[src]
Runs after recursively rendering all sub-items of a module.
fn after_krate(&mut self, krate: &Crate, diag: &Handler) -> Result<(), Error>[src]
Post processing hook for cleanup and dumping output to files.
A handler is available if the renderer wants to report errors.
fn cache(&self) -> &Cache[src]
Implementors
impl<'tcx> FormatRenderer<'tcx> for Context<'tcx>[src]
Generates the documentation for crate into the directory dst
fn descr() -> &'static str[src]
fn init(
krate: Crate,
options: RenderOptions,
edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
fn make_child_renderer(&self) -> Self[src]
fn after_krate(&mut self, krate: &Crate, diag: &Handler) -> Result<(), Error>[src]
fn mod_item_in(&mut self, item: &Item, item_name: &str) -> Result<(), Error>[src]
fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error>[src]
fn item(&mut self, item: Item) -> Result<(), Error>[src]
fn cache(&self) -> &Cache[src]
impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx>[src]
fn descr() -> &'static str[src]
fn init(
krate: Crate,
options: RenderOptions,
_edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
_edition: Edition,
cache: Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
fn make_child_renderer(&self) -> Self[src]
fn item(&mut self, item: Item) -> Result<(), Error>[src]
Inserts an item into the index. This should be used rather than directly calling insert on the hashmap because certain items (traits and types) need to have their mappings for trait implementations filled out before they’re inserted.