Struct rustdoc::html::render::Context[][src]

pub struct Context {
    pub current: Vec<String>,
    pub dst: PathBuf,
    pub render_redirect_pages: bool,
    pub shared: Arc<SharedContext>,
}

Major driving force in all rustdoc rendering. This contains information about where in the tree-like hierarchy rendering is occurring and controls how the current page is being rendered.

It is intended that this context is a lightweight object which can be fairly easily cloned because it is cloned per work-job (about once per item in the rustdoc tree).

Fields

Current hierarchy of components leading down to what's currently being rendered

The current destination folder of where HTML artifacts should be placed. This changes as the context descends into the module hierarchy.

A flag, which when true, will render pages which redirect to the real location of an item. This is used to allow external links to publicly reused items to redirect to the right location.

Methods

impl Context
[src]

String representation of how to get back to the root path of the 'doc/' folder in terms of a relative URL.

Recurse in the directory structure and change the "root path" to make sure it always points to the top (relatively).

Main method for rendering a crate.

This currently isn't parallelized, but it'd be pretty easy to add parallelization to this function.

Non-parallelized version of rendering an item. This will take the input item, render its contents, and then invoke the specified closure with all sub-items which need to be rendered.

The rendering driver uses this closure to queue up more work.

Trait Implementations

impl Clone for Context
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Send for Context

impl !Sync for Context