pub struct Doc {
pub id: Identifier,
pub item: DocItem,
pub custom_attrs: HashMap<String, String>,
}
Expand description
The main structure that represents the documentation for a given symbol / module.
Fields§
§id: Identifier
§item: DocItem
§custom_attrs: HashMap<String, String>
Custom key-value pairs that are not interpreted directly by starlark, and can be used as arbitrary data for documentation tooling.
Implementations§
source§impl Doc
impl Doc
pub fn named_item(name: String, item: DocItem) -> Self
sourcepub fn render_as_code(&self) -> String
pub fn render_as_code(&self) -> String
Render a starlark code representation of this documentation object.
Function bodies for these consist of a single “pass” statement, and objects are represented as structs.
Trait Implementations§
source§impl RenderMarkdown for Doc
impl RenderMarkdown for Doc
source§fn render_markdown_opt(&self, flavor: MarkdownFlavor) -> Option<String>
fn render_markdown_opt(&self, flavor: MarkdownFlavor) -> Option<String>
Generate markdown of the given flavor if possible. For some types, there may not be
any useful documentation available.
source§fn render_markdown(&self, flavor: MarkdownFlavor) -> String
fn render_markdown(&self, flavor: MarkdownFlavor) -> String
Convenience method that invokes
RenderMarkdown::render_markdown_opt
, and returns an
empty string if that is None
impl StructuralPartialEq for Doc
Auto Trait Implementations§
impl !RefUnwindSafe for Doc
impl Send for Doc
impl Sync for Doc
impl Unpin for Doc
impl !UnwindSafe for Doc
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more