#[non_exhaustive]pub enum NodeKind {
Show 31 variants
Document,
Section,
Paragraph,
Heading {
level: u8,
},
FencedCodeBlock,
IndentedCodeBlock,
BlockQuote,
BulletList,
OrderedList,
ListItem,
ThematicBreak,
HtmlBlock,
Table,
TableRow,
TableHeader,
TableDelimiterRow,
LinkReferenceDefinition,
FrontMatter,
Emphasis,
StrongEmphasis,
InlineCode,
Link,
Image,
Strikethrough,
HardLineBreak,
SoftLineBreak,
InfoString,
CodeFenceContent,
Inline,
Text,
Unknown,
}Expand description
Classification of markdown node types from the tree-sitter CST.
These represent the semantic meaning of each node, useful for rendering decisions and command dispatch.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Document
Section
Paragraph
Heading
FencedCodeBlock
IndentedCodeBlock
BlockQuote
BulletList
OrderedList
ListItem
ThematicBreak
HtmlBlock
Table
TableRow
TableHeader
TableDelimiterRow
LinkReferenceDefinition
FrontMatter
Emphasis
StrongEmphasis
InlineCode
Link
Image
Strikethrough
HardLineBreak
SoftLineBreak
InfoString
CodeFenceContent
Inline
Text
Unknown
Implementations§
Source§impl NodeKind
impl NodeKind
Sourcepub fn from_ts_kind(kind: &str) -> Self
pub fn from_ts_kind(kind: &str) -> Self
Classify a tree-sitter node kind string.
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
True if this node can contain other blocks (is a container).
Trait Implementations§
impl Copy for NodeKind
impl Eq for NodeKind
impl StructuralPartialEq for NodeKind
Auto Trait Implementations§
impl Freeze for NodeKind
impl RefUnwindSafe for NodeKind
impl Send for NodeKind
impl Sync for NodeKind
impl Unpin for NodeKind
impl UnsafeUnpin for NodeKind
impl UnwindSafe for NodeKind
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