Struct rustdoc::html::render::context::SharedContext [−][src]
pub(crate) struct SharedContext<'tcx> {Show fields
pub(crate) tcx: TyCtxt<'tcx>,
pub(crate) src_root: PathBuf,
pub(crate) layout: Layout,
pub(crate) include_sources: bool,
pub(crate) local_sources: FxHashMap<PathBuf, String>,
collapsed: bool,
pub(super) issue_tracker_base_url: Option<String>,
created_dirs: RefCell<FxHashSet<PathBuf>>,
pub(super) sort_modules_alphabetically: bool,
pub(crate) style_files: Vec<StylePath>,
pub(crate) resource_suffix: String,
pub(crate) static_root_path: Option<String>,
pub(crate) fs: DocFS,
pub(super) codes: ErrorCodes,
pub(super) playground: Option<Playground>,
all: RefCell<AllTypes>,
errors: Receiver<String>,
redirections: Option<RefCell<FxHashMap<String, String>>>,
}Expand description
Shared mutable state used in Context and elsewhere.
Fields
tcx: TyCtxt<'tcx>src_root: PathBufExpand description
The path to the crate root source minus the file name. Used for simplifying paths to the highlighted source code files.
layout: LayoutExpand description
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: boolExpand description
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.
local_sources: FxHashMap<PathBuf, String>Expand description
The local file sources we’ve emitted and their respective url-paths.
collapsed: boolExpand description
Whether the collapsed pass ran
issue_tracker_base_url: Option<String>Expand description
The base-URL of the issue tracker for when an item has been tagged with an issue number.
created_dirs: RefCell<FxHashSet<PathBuf>>Expand description
The directories that have already been created in this doc run. Used to reduce the number
of spurious create_dir_all calls.
sort_modules_alphabetically: boolExpand description
This flag indicates whether listings of modules (in the side bar and documentation itself) should be ordered alphabetically or in order of appearance (in the source code).
style_files: Vec<StylePath>Expand description
Additional CSS files to be added to the generated docs.
resource_suffix: StringExpand description
Suffix to be added on resource files (if suffix is “-v2” then “light.css” becomes “light-v2.css”).
static_root_path: Option<String>Expand description
Optional path string to be used to load static files on output pages. If not set, uses
combinations of ../ to reach the documentation root.
fs: DocFSExpand description
The fs handle we are working with.
codes: ErrorCodesplayground: Option<Playground>all: RefCell<AllTypes>errors: Receiver<String>Expand description
Storage for the errors produced while generating documentation so they can be printed together at the end.
redirections: Option<RefCell<FxHashMap<String, String>>>Expand description
None by default, depends on the generate-redirect-map option flag. If this field is set
to Some(...), it’ll store redirections and then generate a JSON file at the top level of
the crate.
Implementations
impl SharedContext<'_>[src]
impl SharedContext<'_>[src]pub(crate) fn ensure_dir(&self, dst: &Path) -> Result<(), Error>[src]
pub(crate) fn maybe_collapsed_doc_value<'a>(
&self,
item: &'a Item
) -> Option<String>[src]
pub(crate) fn maybe_collapsed_doc_value<'a>(
&self,
item: &'a Item
) -> Option<String>[src]Based on whether the collapse-docs pass was run, return either the doc_value or the
collapsed_doc_value of the given item.
pub(crate) fn edition(&self) -> Edition[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for SharedContext<'tcx>
impl<'tcx> !Send for SharedContext<'tcx>
impl<'tcx> !Sync for SharedContext<'tcx>
impl<'tcx> Unpin for SharedContext<'tcx>
impl<'tcx> !UnwindSafe for SharedContext<'tcx>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>, pub fn vzip(self) -> V
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,