#[repr(u8)]pub enum MarkdownBlock {
Heading {
level: HeadingLevel,
content: Vec<MarkdownInline>,
},
Paragraph {
content: Vec<MarkdownInline>,
},
UnorderedList {
items: Vec<Vec<Self>>,
},
CodeBlock {
language: Option<String>,
value: String,
},
}Expand description
A block-level Markdown element.
Variants§
Heading
An ATX heading (# Heading).
Fields
§
level: HeadingLevelThe heading level.
§
content: Vec<MarkdownInline>The heading’s inline content.
Paragraph
A paragraph.
Fields
§
content: Vec<MarkdownInline>The paragraph’s inline content.
UnorderedList
A bullet list.
CodeBlock
A fenced code block.
Implementations§
Source§impl MarkdownBlock
impl MarkdownBlock
Sourcepub(crate) fn contains_heading(&self, level: HeadingLevel) -> bool
pub(crate) fn contains_heading(&self, level: HeadingLevel) -> bool
Whether this block, or a block nested in it, is a heading of level.
Source§impl MarkdownBlock
impl MarkdownBlock
Sourcepub(super) fn render_all(blocks: &[Self]) -> Result<String, DocumentError>
pub(super) fn render_all(blocks: &[Self]) -> Result<String, DocumentError>
Render blocks into a complete document.
§Errors
Returns an error if the AST contains invalid values or cannot be rendered.
Trait Implementations§
Source§impl Clone for MarkdownBlock
impl Clone for MarkdownBlock
Source§fn clone(&self) -> MarkdownBlock
fn clone(&self) -> MarkdownBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarkdownBlock
impl Debug for MarkdownBlock
impl Eq for MarkdownBlock
Source§impl<'ʄ> Facet<'ʄ> for MarkdownBlock
impl<'ʄ> Facet<'ʄ> for MarkdownBlock
Source§impl PartialEq for MarkdownBlock
impl PartialEq for MarkdownBlock
impl StructuralPartialEq for MarkdownBlock
Auto Trait Implementations§
impl Freeze for MarkdownBlock
impl RefUnwindSafe for MarkdownBlock
impl Send for MarkdownBlock
impl Sync for MarkdownBlock
impl Unpin for MarkdownBlock
impl UnsafeUnpin for MarkdownBlock
impl UnwindSafe for MarkdownBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.