JsonRenderer in rustdoc::json - Rust (original) (raw)
Struct JsonRenderer
pub(crate) struct JsonRenderer<'tcx> {
tcx: TyCtxt<'tcx>,
index: Rc<RefCell<FxHashMap<Id, Item>>>,
out_dir: Option<PathBuf>,
cache: Rc<Cache>,
imported_items: DefIdSet,
id_interner: Rc<RefCell<FxHashMap<FullItemId, Id>>>,
}
A mapping of IDs that contains all local items for this crate which gets output as a top level field of the JSON blob.
The directory where the JSON blob should be written to.
If this is None
, the blob will be printed to stdout
instead.
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.
Whether to call item
recursively for modules Read more
This associated type is the type where the current module information is stored. Read more
Gives a description of the renderer. Used for performance profiling.
Sets up any state required for the renderer. When this is called the cache has already been populated.
This method is called right before call Self::item. This method returns a type containing information that needs to be reset after the Self::item method has been called with the Self::restore_module_data method. Read more
Used to reset current module’s information.
Renders a module (should not handle recursing into children).
Post processing hook for cleanup and dumping output to files.
Runs after recursively rendering all sub-items of a module.
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes