Docs

Struct Docs 

Source
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: String

The 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

Source

pub fn of(program: &Program) -> Docs

Derive a module’s documentation from the checked, placed program.

Source

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.

Source

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.

Source§

impl Docs

Source

pub fn to_markdown(&self) -> String

Markdown — the form that is checked in and diffed.

Source

pub fn to_json(&self) -> String

JSON — the form a tool consumes. Hand-written rather than derived, so the shape is a decision in this file rather than a consequence of the Rust field names.

Source§

impl Docs

Source

pub fn to_html(&self, repo: Option<&str>) -> String

HTML — the form that is published. repo is page’s: the repository to link back to.

Trait Implementations§

Source§

impl Clone for Docs

Source§

fn clone(&self) -> Docs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Docs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Docs

Source§

fn default() -> Docs

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Docs

Source§

fn eq(&self, other: &Docs) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Docs

Source§

impl StructuralPartialEq for Docs

Auto Trait Implementations§

§

impl Freeze for Docs

§

impl RefUnwindSafe for Docs

§

impl Send for Docs

§

impl Sync for Docs

§

impl Unpin for Docs

§

impl UnwindSafe for Docs

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.