[−][src]Module rustdoc::html::render

Rustdoc's HTML rendering module.

This modules contains the bulk of the logic necessary for rendering a rustdoc clean::Crate instance to a set of static HTML pages. This rendering process is largely driven by the format! syntax extension to perform all I/O into files and streams.

The rendering process is largely driven by the Context and Cache structures. The cache is pre-populated by crawling the crate in question, and then it is shared among the various rendering threads. The cache is meant to be a fairly large structure not implementing Clone (because it's shared among threads). The context, however, should be a lightweight structure. This is cloned per-thread and contains information about what is currently being rendered.

In order to speed up rendering (mostly because of markdown rendering), the rendering process has been parallelized. This parallelization is only exposed through the crate method on the context, and then also from the fact that the shared cache is stored in TLS (and must be accessed as such).

In addition to rendering the crate itself, this module is also responsible for creating the corresponding search index and source file renderings. These threads are not parallelized (they haven't been a bottleneck yet), and both occur before the crate is rendered.

Modules

cache

Structs

AllTypes
Context

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.

Generic

A type used for the search index.

IndexItem

Struct representing one entry in the JS search index. These are all emitted by hand to a large JS file at the end of cache-creation.

IndexItemFunctionType

Full type of functions/methods in the search index.

ItemEntry
RenderType

A type used for the search index.

SharedContext
StylePath
TypeWithKind

Enums

AssocItemLink
Setting

Constants

ALLOWED_ATTRIBUTES
BASIC_KEYWORDS
CURRENT_DEPTH

Functions

assoc_const
assoc_type
bounds
collect_paths_for_type

Returns a list of all paths used in the type. This is used to help deduplicate imported impls for reexported types. If any of the contained types are re-exported, we don't use the corresponding entry from the js file, as inlining will have already picked up the impl

compare_impl
compare_names

Compare two strings treating multi-digit numbers as single units (i.e. natural sort order).

document
document_full
document_non_exhaustive
document_non_exhaustive_header
document_short

Writes a documentation block containing only the first paragraph of the documentation. If the docs are longer, a "Read more" link is appended to the end.

document_stability
ensure_trailing_slash
extract_for_impl_name
full_path
get_id_for_impl_on_foreign_type
get_methods
get_next_url
get_struct_fields_name
initial_ids
is_negative_impl
item_constant
item_enum
item_foreign_type
item_function
item_keyword
item_macro
item_module
item_opaque_ty
item_path
item_primitive
item_proc_macro
item_static
item_struct
item_trait
item_trait_alias
item_ty_to_strs
item_typedef
item_union
make_item_keywords
naive_assoc_href
plain_text_summary

Renders the first paragraph of the given markdown as plain text, making it suitable for contexts like alt-text or the search index.

portability
print_entries
print_item
print_sidebar
render_assoc_item
render_assoc_items
render_attributes
render_deref_methods
render_impl
render_implementor
render_impls
render_markdown

Render md_text as markdown.

render_stability_since
render_stability_since_raw
render_struct
render_union
settings
short_stability

Render the stability and/or deprecation warning that is displayed at the top of the item's documentation.

shorten
should_render_item
sidebar_assoc_items
sidebar_enum
sidebar_foreign_type
sidebar_module
sidebar_primitive
sidebar_struct
sidebar_trait
sidebar_typedef
sidebar_union
small_url_encode
spotlight_decl
stability_tags

Render the stability and deprecation tags that are displayed in the item's summary at the module level.

wrap_into_docblock
write_minify
write_shared
write_srclink

Type Definitions

NameDoc

A pair of name and its optional document.