Skip to main content

KindData

Enum KindData 

Source
#[non_exhaustive]
pub enum KindData {
Show 23 variants Document(Document), Paragraph(Paragraph), Heading(Heading), ThematicBreak(ThematicBreak), CodeBlock(CodeBlock), Blockquote(Blockquote), List(List), ListItem(ListItem), HtmlBlock(HtmlBlock), Text(Text), CodeSpan(CodeSpan), Emphasis(Emphasis), Link(Link), Image(Image), RawHtml(RawHtml), LinkReferenceDefinition(LinkReferenceDefinition), Table(Table), TableHeader(TableHeader), TableBody(TableBody), TableRow(TableRow), TableCell(TableCell), Strikethrough(Strikethrough), Extension(Box<dyn ExtensionData>),
}
Expand description

Represents the data of a node in the document. This is an enum that can hold different types of node data.

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(Document)

§

Paragraph(Paragraph)

§

Heading(Heading)

§

ThematicBreak(ThematicBreak)

§

CodeBlock(CodeBlock)

§

Blockquote(Blockquote)

§

List(List)

§

ListItem(ListItem)

§

HtmlBlock(HtmlBlock)

§

Text(Text)

§

CodeSpan(CodeSpan)

§

Emphasis(Emphasis)

§

Image(Image)

§

RawHtml(RawHtml)

§

LinkReferenceDefinition(LinkReferenceDefinition)

§

Table(Table)

§

TableHeader(TableHeader)

§

TableBody(TableBody)

§

TableRow(TableRow)

§

TableCell(TableCell)

§

Strikethrough(Strikethrough)

§

Extension(Box<dyn ExtensionData>)

Implementations§

Source§

impl KindData

Source

pub fn typ(&self) -> NodeType

Returns the type of the node.

Source

pub fn kind_name(&self) -> &'static str

Returns the kind name of the node.

Source

pub fn pretty_print( &self, w: &mut dyn Write, source: &str, level: usize, ) -> Result

Pretty prints the node data.

Trait Implementations§

Source§

impl Debug for KindData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Blockquote> for KindData

Source§

fn from(data: Blockquote) -> Self

Converts to this type from the input type.
Source§

impl From<CodeBlock> for KindData

Source§

fn from(data: CodeBlock) -> Self

Converts to this type from the input type.
Source§

impl From<CodeSpan> for KindData

Source§

fn from(data: CodeSpan) -> Self

Converts to this type from the input type.
Source§

impl From<Document> for KindData

Source§

fn from(data: Document) -> Self

Converts to this type from the input type.
Source§

impl From<Emphasis> for KindData

Source§

fn from(data: Emphasis) -> Self

Converts to this type from the input type.
Source§

impl From<Heading> for KindData

Source§

fn from(data: Heading) -> Self

Converts to this type from the input type.
Source§

impl From<HtmlBlock> for KindData

Source§

fn from(data: HtmlBlock) -> Self

Converts to this type from the input type.
Source§

impl From<Image> for KindData

Source§

fn from(data: Image) -> Self

Converts to this type from the input type.
Source§

impl From<Link> for KindData

Source§

fn from(data: Link) -> Self

Converts to this type from the input type.
Source§

impl From<LinkReferenceDefinition> for KindData

Source§

fn from(data: LinkReferenceDefinition) -> Self

Converts to this type from the input type.
Source§

impl From<List> for KindData

Source§

fn from(data: List) -> Self

Converts to this type from the input type.
Source§

impl From<ListItem> for KindData

Source§

fn from(data: ListItem) -> Self

Converts to this type from the input type.
Source§

impl From<Paragraph> for KindData

Source§

fn from(data: Paragraph) -> Self

Converts to this type from the input type.
Source§

impl From<RawHtml> for KindData

Source§

fn from(data: RawHtml) -> Self

Converts to this type from the input type.
Source§

impl From<Strikethrough> for KindData

Source§

fn from(e: Strikethrough) -> Self

Converts to this type from the input type.
Source§

impl From<Table> for KindData

Source§

fn from(e: Table) -> Self

Converts to this type from the input type.
Source§

impl From<TableBody> for KindData

Source§

fn from(e: TableBody) -> Self

Converts to this type from the input type.
Source§

impl From<TableCell> for KindData

Source§

fn from(e: TableCell) -> Self

Converts to this type from the input type.
Source§

impl From<TableHeader> for KindData

Source§

fn from(e: TableHeader) -> Self

Converts to this type from the input type.
Source§

impl From<TableRow> for KindData

Source§

fn from(e: TableRow) -> Self

Converts to this type from the input type.
Source§

impl From<Text> for KindData

Source§

fn from(data: Text) -> Self

Converts to this type from the input type.
Source§

impl From<ThematicBreak> for KindData

Source§

fn from(data: ThematicBreak) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.