[−][src]Struct rustdoc::html::render::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.
It is intended that this context is a lightweight object which can be fairly easily cloned because it is cloned per work-job (about once per item in the rustdoc tree).
Fields
current: Vec<String>Current hierarchy of components leading down to what's currently being rendered
dst: PathBufThe current destination folder of where HTML artifacts should be placed. This changes as the context descends into the module hierarchy.
render_redirect_pages: boolA flag, which when true, will render pages which redirect to the
real location of an item. This is used to allow external links to
publicly reused items to redirect to the right location.
id_map: Rc<RefCell<IdMap>>The map used to ensure all generated 'id=' attributes are unique.
all: Rc<RefCell<AllTypes>>errors: Rc<Receiver<String>>Storage for the errors produced while generating documentation so they can be printed together at the end.
Implementations
impl Context[src]
impl Context[src]
pub(in html::render) fn derive_id(
&self,
id: String
) -> String[src]
&self,
id: String
) -> String
pub(in html::render) fn root_path(
&self
) -> String[src]
&self
) -> String
String representation of how to get back to the root path of the 'doc/' folder in terms of a relative URL.
pub(in html::render) fn render_item(
&self,
it: &Item,
pushname: bool,
cache: &Cache
) -> String[src]
&self,
it: &Item,
pushname: bool,
cache: &Cache
) -> String
pub(in html::render) fn build_sidebar_items(
&self,
m: &Module
) -> BTreeMap<String, Vec<(String, Option<String>)>>[src]
&self,
m: &Module
) -> BTreeMap<String, Vec<(String, Option<String>)>>
Construct a map of items shown in the sidebar to a plain-text summary of their docs.
pub(in html::render) fn src_href(
&self,
item: &Item,
cache: &Cache
) -> Option<String>[src]
&self,
item: &Item,
cache: &Cache
) -> Option<String>
Generates a url appropriate for an href attribute back to the source of
this item.
The url generated, when clicked, will redirect the browser back to the original source code.
If None is returned, then a source link couldn't be generated. This
may happen, for example, with externally inlined items where the source
of their crate documentation isn't known.
Trait Implementations
impl Clone for Context[src]
impl FormatRenderer for Context[src]
Generates the documentation for crate into the directory dst
pub(crate) fn init(
krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
edition: Edition,
cache: &mut Cache
) -> Result<(Context, Crate), Error>[src]
krate: Crate,
options: RenderOptions,
_render_info: RenderInfo,
edition: Edition,
cache: &mut Cache
) -> Result<(Context, Crate), Error>
pub(crate) fn after_run(&mut self, diag: &Handler) -> Result<(), Error>[src]
pub(crate) fn after_krate(
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
krate: &Crate,
cache: &Cache
) -> Result<(), Error>
pub(crate) fn mod_item_in(
&mut self,
item: &Item,
item_name: &str,
cache: &Cache
) -> Result<(), Error>[src]
&mut self,
item: &Item,
item_name: &str,
cache: &Cache
) -> Result<(), Error>
pub(crate) fn mod_item_out(&mut self, _item_name: &str) -> Result<(), Error>[src]
pub(crate) fn item(&mut self, item: Item, cache: &Cache) -> Result<(), Error>[src]
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,