pub struct DocEntry(/* private fields */);Expand description
A flexible document entry that serializes as a flat JSON object.
Each entry has a "phase": "runtime" field set automatically.
Implementations§
Source§impl DocEntry
impl DocEntry
Sourcepub fn code(label: &str, content: &str, lang: Option<&str>) -> Self
pub fn code(label: &str, content: &str, lang: Option<&str>) -> Self
A code block with optional language.
Sourcepub fn json_doc(label: &str, value: &impl Serialize) -> Self
pub fn json_doc(label: &str, value: &impl Serialize) -> Self
A JSON document rendered as a code block with lang=json.
Sourcepub fn table(label: &str, columns: &[&str], rows: &[&[&str]]) -> Self
pub fn table(label: &str, columns: &[&str], rows: &[&[&str]]) -> Self
A table with columns and rows.
Sourcepub fn screenshot(path: &str, alt: Option<&str>) -> Self
pub fn screenshot(path: &str, alt: Option<&str>) -> Self
A screenshot reference.
Sourcepub fn custom(type_name: &str, data: Value) -> Self
pub fn custom(type_name: &str, data: Value) -> Self
A custom doc entry with arbitrary type and data.
Sourcepub fn with_children(self, children: Vec<DocEntry>) -> Self
pub fn with_children(self, children: Vec<DocEntry>) -> Self
Add children to this doc entry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocEntry
impl RefUnwindSafe for DocEntry
impl Send for DocEntry
impl Sync for DocEntry
impl Unpin for DocEntry
impl UnsafeUnpin for DocEntry
impl UnwindSafe for DocEntry
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