Skip to main content

Module json

Module json 

Source
Expand description

Rustdoc’s JSON backend

This module contains the logic for rendering a crate as JSON rather than the normal static HTML output. See the RFC and the types module docs for usage and details.

Re-exportsΒ§

use std::cell::RefCell; πŸ”’
use std::fs::File; πŸ”’
use std::fs::create_dir_all; πŸ”’
use std::io::BufWriter; πŸ”’
use std::io::Write; πŸ”’
use std::io::stdout; πŸ”’
use std::path::PathBuf; πŸ”’
use std::rc::Rc; πŸ”’
use rustc_hir::def::DefKind; πŸ”’
use rustc_hir::def_id::DefId; πŸ”’
use rustc_hir::def_id::DefIdSet; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_session::Session; πŸ”’
use rustc_span::def_id::LOCAL_CRATE; πŸ”’
use rustdoc_json_types as types; πŸ”’
use rustdoc_json_types::FxHashMap; πŸ”’
use tracing::debug; πŸ”’
use tracing::trace; πŸ”’
use crate::clean::ItemKind; πŸ”’
use crate::clean::types::ExternalCrate; πŸ”’
use crate::clean::types::ExternalLocation; πŸ”’
use crate::config::EmitType; πŸ”’
use crate::config::RenderOptions; πŸ”’
use crate::docfs::PathError; πŸ”’
use crate::error::Error; πŸ”’
use crate::formats::FormatRenderer; πŸ”’
use crate::formats::cache::Cache; πŸ”’
use crate::formats::item_type::ItemType; πŸ”’
use crate::json::conversions::IntoJson; πŸ”’
use crate::passes::collect_intra_doc_links::UrlFragment; πŸ”’
use crate::clean; πŸ”’
use crate::try_err; πŸ”’

ModulesΒ§

conversions πŸ”’
These from impls are used to create the JSON types which get serialized. They’re very close to the clean types but with some fields removed or stringified to simplify the output and not expose unstable compiler internals.
ids πŸ”’
Id handling for rustdoc-json.
import_finder πŸ”’
size_asserts πŸ”’

StructsΒ§

JsonRenderer πŸ”’

FunctionsΒ§

serialize_and_write πŸ”’