pub enum Node {
Heading {
level: HeadingLevel,
text: RichText,
source_range: SourceRange<usize>,
},
Paragraph {
text: RichText,
source_range: SourceRange<usize>,
},
CodeBlock {
lang: Option<String>,
text: RichText,
source_range: SourceRange<usize>,
},
BlockQuote {
kind: Option<BlockQuoteKind>,
title: Option<String>,
nodes: Vec<Node>,
source_range: SourceRange<usize>,
},
List {
nodes: Vec<Node>,
source_range: SourceRange<usize>,
},
Item {
kind: ItemKind,
nodes: Vec<Node>,
source_range: SourceRange<usize>,
},
Task {
kind: TaskKind,
nodes: Vec<Node>,
source_range: SourceRange<usize>,
},
Table {
alignments: Vec<Alignment>,
head: Vec<RichText>,
rows: Vec<Vec<RichText>>,
source_range: SourceRange<usize>,
},
}Expand description
The Markdown AST node enumeration.
Variants§
Heading
Paragraph
CodeBlock
BlockQuote
Fields
§
kind: Option<BlockQuoteKind>§
title: Option<String>Custom callout title (Obsidian > [!note] Title); None falls back
to the kind’s own label.
§
source_range: SourceRange<usize>List
Item
Task
Table
A GFM table with a header row and zero or more body rows. Each cell is the [RichText]
between two pipes; alignments holds one Alignment per column.
Implementations§
Source§impl Node
impl Node
pub fn source_range(&self) -> &SourceRange<usize>
pub fn set_source_range(&mut self, new_range: SourceRange<usize>)
pub fn rich_text(&self) -> Option<&RichText>
pub fn children_as_mut(&mut self) -> Option<&mut Vec<Self>>
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more