pub struct RenderContext {
    pub version: String,
    pub root: PathBuf,
    pub book: Book,
    pub config: Config,
    pub destination: PathBuf,
    /* private fields */
}
Expand description

The context provided to all renderers.

Fields

version: String

Which version of mdbook did this come from (as written in mdbook’s Cargo.toml). Useful if you know the renderer is only compatible with certain versions of mdbook.

root: PathBuf

The book’s root directory.

book: Book

A loaded representation of the book itself.

config: Config

The loaded configuration file.

destination: PathBuf

Where the renderer must put any build artefacts generated. To allow renderers to cache intermediate results, this directory is not guaranteed to be empty or even exist.

Implementations

Create a new RenderContext.

Get the source directory’s (absolute) path on disk.

Load a RenderContext from its JSON representation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.