Struct rustdoc::json::JsonRenderer[−][src]

pub(crate) struct JsonRenderer<'tcx> {
    tcx: TyCtxt<'tcx>,
    index: Rc<RefCell<FxHashMap<Id, Item>>>,
    out_path: PathBuf,
    cache: Rc<Cache>,
}

Fields

tcx: TyCtxt<'tcx>index: Rc<RefCell<FxHashMap<Id, Item>>>
Expand description

A mapping of IDs that contains all local items for this crate which gets output as a top level field of the JSON blob.

out_path: PathBuf
Expand description

The directory where the blob will be written to.

cache: Rc<Cache>

Implementations

impl JsonRenderer<'_>[src]

pub(super) fn convert_item(&self, item: Item) -> Option<Item>[src]

fn convert_span(&self, span: Span) -> Option<Span>[src]

fn convert_visibility(&self, v: Visibility) -> Visibility[src]

impl<'tcx> JsonRenderer<'tcx>[src]

fn sess(&self) -> &'tcx Session[src]

fn get_trait_implementors(&mut self, id: FakeDefId) -> Vec<Id>[src]

fn get_impls(&mut self, id: FakeDefId) -> Vec<Id>[src]

fn get_trait_items(&mut self) -> Vec<(Id, Item)>[src]

Trait Implementations

impl<'tcx> Clone for JsonRenderer<'tcx>[src]

fn clone(&self) -> JsonRenderer<'tcx>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx>[src]

fn item(&mut self, item: Item) -> Result<(), Error>[src]

Inserts an item into the index. This should be used rather than directly calling insert on the hashmap because certain items (traits and types) need to have their mappings for trait implementations filled out before they’re inserted.

fn descr() -> &'static str[src]

Gives a description of the renderer. Used for performance profiling.

const RUN_ON_MODULE: bool[src]

Whether to call item recursivly for modules Read more

fn init(
    krate: Crate,
    options: RenderOptions,
    cache: Cache,
    tcx: TyCtxt<'tcx>
) -> Result<(Self, Crate), Error>
[src]

Sets up any state required for the renderer. When this is called the cache has already been populated. Read more

fn make_child_renderer(&self) -> Self[src]

Make a new renderer to render a child of the item currently being rendered.

fn mod_item_in(&mut self, _item: &Item) -> Result<(), Error>[src]

Renders a module (should not handle recursing into children).

fn after_krate(&mut self) -> Result<(), Error>[src]

Post processing hook for cleanup and dumping output to files.

fn cache(&self) -> &Cache[src]

fn mod_item_out(&mut self) -> Result<(), Error>[src]

Runs after recursively rendering all sub-items of a module.

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for JsonRenderer<'tcx>

impl<'tcx> !Send for JsonRenderer<'tcx>

impl<'tcx> !Sync for JsonRenderer<'tcx>

impl<'tcx> Unpin for JsonRenderer<'tcx>

impl<'tcx> !UnwindSafe for JsonRenderer<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[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]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

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]