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

pub struct Cache {
    pub typarams: FxHashMap<DefId, String>,
    pub impls: FxHashMap<DefId, Vec<Impl>>,
    pub paths: FxHashMap<DefId, (Vec<String>, ItemType)>,
    pub external_paths: FxHashMap<DefId, (Vec<String>, ItemType)>,
    pub traits: FxHashMap<DefId, Trait>,
    pub implementors: FxHashMap<DefId, Vec<Implementor>>,
    pub extern_locations: FxHashMap<CrateNum, (String, PathBuf, ExternalLocation)>,
    pub primitive_locations: FxHashMap<PrimitiveType, DefId>,
    pub access_levels: Arc<AccessLevels<DefId>>,
    // some fields omitted
}
🔬 This is a nightly-only experimental API. (rustdoc)

This cache is used to store information about the clean::Crate being rendered in order to provide more useful documentation. This contains information like all implementors of a trait, all traits a type implements, documentation for all known traits, etc.

This structure purposefully does not implement Clone because it's intended to be a fairly large and expensive structure to clone. Instead this adheres to Send so it may be stored in a Arc instance and shared among the various rendering threads.

Fields

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

Mapping of typaram ids to the name of the type parameter. This is used when pretty-printing a type (so pretty printing doesn't have to painfully maintain a context like this)

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

Maps a type id to all known implementations for that type. This is only recognized for intra-crate ResolvedPath types, and is used to print out extra documentation on the page of an enum/struct.

The values of the map are a list of implementations and documentation found on that implementation.

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

Maintains a mapping of local crate node ids to the fully qualified name and "short type description" of that node. This is used when generating URLs when a type is being linked to. External paths are not located in this map because the External type itself has all the information necessary.

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

Similar to paths, but only holds external paths. This is only used for generating explicit hyperlinks to other crates.

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

This map contains information about all known traits of this crate. Implementations of a crate should inherit the documentation of the parent trait if no extra documentation is specified, and default methods should show up in documentation about trait implementations.

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

When rendering traits, it's often useful to be able to list all implementors of the trait, and this mapping is exactly, that: a mapping of trait ids to the list of known implementors of the trait

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

Cache of where external crate documentation can be found.

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

Cache of where documentation for primitives can be found.

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

Trait Implementations

impl Default for Cache
[src]

Returns the "default value" for a type. Read more

impl DocFolder for Cache
[src]

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

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

don't override!

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

don't override!

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

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