Module write_shared

Source
Expand description

Rustdoc writes aut two kinds of shared files:

  • Static files, which are embedded in the rustdoc binary and are written with a filename that includes a hash of their contents. These will always have a new URL if the contents change, so they are safe to cache with the Cache-Control: immutable directive. They are written under the static.files/ directory and are written when –emit-type is empty (default) or contains “toolchain-specific”. If using the –static-root-path flag, it should point to a URL path prefix where each of these filenames can be fetched.
  • Invocation specific files. These are generated based on the crate(s) being documented. Their filenames need to be predictable without knowing their contents, so they do not include a hash in their filename and are not safe to cache with Cache-Control: immutable. They include the contents of the –resource-suffix flag and are emitted when –emit-type is empty (default) or contains “invocation-specific”.

Structs§

AliasSerializableImpl 🔒
Final serialized form of the alias impl
AliasedType 🔒
Data for an aliased type.
AliasedTypeImpl 🔒
The impl_ contains data that’s used to figure out if an alias will work, and to generate the HTML at the end.
AllCrates 🔒
CrateInfo 🔒
Contains pre-rendered contents to insert into the CCI template
CratesIndex 🔒
Hierarchy 🔒
Source files directory tree
Implementor 🔒
Part 🔒
A piece of one of the shared artifacts for documentation (search index, sources, alias list, etc.)
PartsAndLocations 🔒
Paths (relative to the doc root) and their pre-merge contents
SearchIndex 🔒
Sources 🔒
TraitAlias 🔒
TypeAlias 🔒
TypeImplCollector 🔒
Collect the list of aliased types and their aliases. https://github.com/search?q=repo%3Arust-lang%2Frust+[RUSTDOCIMPL]+type.impl&type=code

Enums§

CrateInfoVersion 🔒
Version for the format of the crate-info file.

Traits§

CciPart 🔒
Wrapper trait for Part<T, U>

Functions§

create_parents 🔒
Create all parents
get_path_parts 🔒
hack_get_external_crate_names 🔒
Reads crates.js, which seems like the best place to obtain the list of externally documented crates if the index page was disabled when documenting the deps.
read_template_or_blank 🔒
Returns a blank template unless we could find one to append to
write_not_crate_specific 🔒
Writes files that are written directly to the --out-dir, without the prefix from the current crate. These are the rendered cross-crate files that encode info from multiple crates (e.g. search index), and the static files.
write_rendered_cci 🔒
info from this crate and the –include-info-json’d crates
write_rendered_cross_crate_info 🔒
write_search_desc 🔒
Write the search description shards to disk
write_shared 🔒
write_static_files 🔒
Writes the static files, the style files, and the css extensions. Have to be careful about these, because they write to the root out dir.

Type Aliases§

AllCratesPart 🔒
CratesIndexPart 🔒
SearchIndexPart 🔒
SourcesPart 🔒
TraitAliasPart 🔒
TypeAliasPart 🔒