pub struct Docs {
pub module: String,
pub digest: String,
pub types: Vec<TypeEntry>,
pub items: Vec<Entry>,
}Expand description
A module’s reference documentation.
Fields§
§module: String§digest: StringThe interface digest this page was generated from — the same value
crate::iface::Interface::digest publishes, so a page can be matched to a contract.
types: Vec<TypeEntry>§items: Vec<Entry>Implementations§
Source§impl Docs
impl Docs
Sourcepub fn of(program: &Program) -> Docs
pub fn of(program: &Program) -> Docs
Derive a module’s documentation from the checked, placed program.
Sourcepub fn of_interface(
iface: &Interface,
comments: &BTreeMap<Arc<str>, Arc<str>>,
) -> Docs
pub fn of_interface( iface: &Interface, comments: &BTreeMap<Arc<str>, Arc<str>>, ) -> Docs
The page for an interface that has already been computed.
A module that imports another is checked as part of a project, and the program that
comes out of the slicer is every module merged — which is right for slicing and wrong for a
documentation page, because beck doc on one module would then publish the names of every
module beneath it. Project::interface is the root module’s own
contract, and it is what a page is of. docs/56 §56.5 is where that was found.
The doc-comment map is the program’s, because a comment is looked up by the name it documents and the interface selects which names those are.
Sourcepub fn documented(&self) -> (usize, usize)
pub fn documented(&self) -> (usize, usize)
How many published names carry a doc comment, and how many there are.
Reported rather than enforced: a coverage gate that fails a build is how a codebase ends up
with ## the id on a field called id. The number is here so it can be looked at.