pub enum Node {
Show 21 variants
Document(Vec<Node>),
Heading {
level: u8,
content: Vec<Node>,
},
Paragraph(Vec<Node>),
BlockQuote(Vec<Node>),
CodeBlock {
language: Option<String>,
content: String,
},
UnorderedList(Vec<ListItem>),
OrderedList {
start: u32,
items: Vec<ListItem>,
},
ThematicBreak,
Table {
headers: Vec<Node>,
rows: Vec<Vec<Node>>,
alignments: Vec<Alignment>,
},
HtmlBlock(String),
Text(String),
Emphasis(Vec<Node>),
Strong(Vec<Node>),
Strike(Vec<Node>),
InlineCode(String),
Link {
url: String,
title: Option<String>,
content: Vec<Node>,
},
Image {
url: String,
title: Option<String>,
alt: Vec<Node>,
},
InlineContainer(Vec<Node>),
HtmlElement(HtmlElement),
SoftBreak,
HardBreak,
}Expand description
Main node type, representing an element in a CommonMark document
Variants§
Document(Vec<Node>)
Root document node, contains child nodes
Heading
Heading, contains level (1-6) and inline content
Paragraph(Vec<Node>)
Paragraph node, containing inline elements
BlockQuote(Vec<Node>)
Block quote, containing any block-level elements
CodeBlock
Code block, containing optional language identifier and content
UnorderedList(Vec<ListItem>)
Unordered list, containing list items
OrderedList
Ordered list, containing starting number and list items
ThematicBreak
Thematic break (horizontal rule)
Table
Table
Fields
HtmlBlock(String)
HTML block
Text(String)
Plain text
Emphasis(Vec<Node>)
Emphasis (italic)
Strong(Vec<Node>)
Strong emphasis (bold)
Strike(Vec<Node>)
Strikethrough
InlineCode(String)
Inline code
Link
Link
Image
Image
Fields
InlineContainer(Vec<Node>)
Inline element collection, without formatting and line breaks
HtmlElement(HtmlElement)
HTML inline element
SoftBreak
Soft break (single line break)
HardBreak
Hard break (two spaces followed by a line break, or backslash followed by a line break)
Implementations§
Trait Implementations§
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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