[−][src]Trait rustdoc::formats::renderer::FormatRenderer
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,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
render_info: RenderInfo,
edition: Edition,
cache: &mut 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.
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]
&mut self,
item: &Item,
item_name: &str,
cache: &Cache
) -> Result<(), Error>
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]
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>
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.
Implementors
impl<'tcx> FormatRenderer<'tcx> for Context<'tcx>[src]
Generates the documentation for crate into the directory dst
pub(crate) fn init(
mut krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
edition: Edition,
cache: &mut Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
mut krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
edition: Edition,
cache: &mut Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
pub(crate) fn after_run(&mut self, diag: &Handler) -> Result<(), Error>[src]
pub(crate) fn after_krate(
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>
pub(crate) fn mod_item_in(
&mut self,
item: &Item,
item_name: &str,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
item: &Item,
item_name: &str,
cache: &Cache
) -> Result<(), Error>
pub(crate) fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error>[src]
pub(crate) fn item(&mut self, item: Item, cache: &Cache) -> Result<(), Error>[src]
impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx>[src]
pub(crate) fn init(
krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
_edition: Edition,
_cache: &mut Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
_edition: Edition,
_cache: &mut Cache,
tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
pub(crate) fn item(&mut self, item: Item, cache: &Cache) -> 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.
pub(crate) fn mod_item_in(
&mut self,
item: &Item,
_module_name: &str,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
item: &Item,
_module_name: &str,
cache: &Cache
) -> Result<(), Error>
pub(crate) fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error>[src]
pub(crate) fn after_krate(
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>