Struct rustdoc::html::render::ContextUnstable [-] [+] [src]

pub struct Context {
    pub current: Vec<String>,
    pub root_path: String,
    pub src_root: PathBuf,
    pub dst: PathBuf,
    pub layout: Layout,
    pub include_sources: bool,
    pub render_redirect_pages: bool,
    pub passes: HashSet<String>,
}

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

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

root_path

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

src_root

The path to the crate root source minus the file name. Used for simplifying paths to the highlighted source code files.

dst

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

layout

This describes the layout of each page, and is not modified after creation of the context (contains info like the favicon and added html).

include_sources

This flag indicates whether [src] links should be generated or not. If the source files are present in the html rendering, then this will be true.

render_redirect_pages

A flag, which when turned off, 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.

passes

All the passes that were run on this crate.

Trait Implementations

Derived Implementations

impl Clone for Context

fn clone(&self) -> Context

fn clone_from(&mut self, source: &Self)