Enum Expr

Source
pub enum Expr<'a> {
Show 39 variants Root(Vec<NodeID>), Heading(Heading<'a>), Block(Block<'a>), RegularLink(RegularLink<'a>), Paragraph(Paragraph), Italic(Italic), Bold(Bold), StrikeThrough(StrikeThrough), Underline(Underline), PlainList(PlainList), Item(Item<'a>), Table(Table), TableRow(TableRow), TableCell(TableCell), PlainLink(PlainLink<'a>), Superscript(Superscript<'a>), Subscript(Subscript<'a>), Drawer(Drawer<'a>), Affiliated(Affiliated<'a>), FootnoteDef(FootnoteDef<'a>), FootnoteRef(FootnoteRef<'a>), BlankLine, SoftBreak, LineBreak, HorizontalRule, Plain(&'a str), Verbatim(Verbatim<'a>), Code(Code<'a>), Comment(Comment<'a>), InlineSrc(InlineSrc<'a>), Keyword(Keyword<'a>), LatexEnv(LatexEnv<'a>), LatexFragment(LatexFragment<'a>), Entity(Entity<'a>), Emoji(Emoji<'a>), Target(Target<'a>), Macro(MacroCall<'a>), ExportSnippet(ExportSnippet<'a>), MacroDef(MacroDef<'a>),
}
Expand description

An enum that represents all possible AST nodes

Variants§

§

Root(Vec<NodeID>)

§

Heading(Heading<'a>)

§

Block(Block<'a>)

§

Paragraph(Paragraph)

§

Italic(Italic)

§

Bold(Bold)

§

StrikeThrough(StrikeThrough)

§

Underline(Underline)

§

PlainList(PlainList)

§

Item(Item<'a>)

§

Table(Table)

§

TableRow(TableRow)

§

TableCell(TableCell)

§

Superscript(Superscript<'a>)

§

Subscript(Subscript<'a>)

§

Drawer(Drawer<'a>)

§

Affiliated(Affiliated<'a>)

§

FootnoteDef(FootnoteDef<'a>)

§

FootnoteRef(FootnoteRef<'a>)

§

BlankLine

§

SoftBreak

§

LineBreak

§

HorizontalRule

§

Plain(&'a str)

§

Verbatim(Verbatim<'a>)

§

Code(Code<'a>)

§

Comment(Comment<'a>)

§

InlineSrc(InlineSrc<'a>)

§

Keyword(Keyword<'a>)

§

LatexEnv(LatexEnv<'a>)

§

LatexFragment(LatexFragment<'a>)

§

Entity(Entity<'a>)

§

Emoji(Emoji<'a>)

§

Target(Target<'a>)

§

Macro(MacroCall<'a>)

§

ExportSnippet(ExportSnippet<'a>)

§

MacroDef(MacroDef<'a>)

Implementations§

Source§

impl<'a> Expr<'a>

Source

pub fn children_mut(&mut self) -> Option<&mut Vec<NodeID>>

Source

pub fn children(&self) -> Option<&Vec<NodeID>>

Trait Implementations§

Source§

impl<'a> Clone for Expr<'a>

Source§

fn clone(&self) -> Expr<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Expr<'a>

Source§

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

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

impl<'a> From<&'a str> for Expr<'a>

Source§

fn from(original: &'a str) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Affiliated<'a>> for Expr<'a>

Source§

fn from(original: Affiliated<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Block<'a>> for Expr<'a>

Source§

fn from(original: Block<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Bold> for Expr<'a>

Source§

fn from(original: Bold) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Code<'a>> for Expr<'a>

Source§

fn from(original: Code<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Comment<'a>> for Expr<'a>

Source§

fn from(original: Comment<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Drawer<'a>> for Expr<'a>

Source§

fn from(original: Drawer<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Emoji<'a>> for Expr<'a>

Source§

fn from(original: Emoji<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Entity<'a>> for Expr<'a>

Source§

fn from(original: Entity<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<ExportSnippet<'a>> for Expr<'a>

Source§

fn from(original: ExportSnippet<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<FootnoteDef<'a>> for Expr<'a>

Source§

fn from(original: FootnoteDef<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<FootnoteRef<'a>> for Expr<'a>

Source§

fn from(original: FootnoteRef<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Heading<'a>> for Expr<'a>

Source§

fn from(original: Heading<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<InlineSrc<'a>> for Expr<'a>

Source§

fn from(original: InlineSrc<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Italic> for Expr<'a>

Source§

fn from(original: Italic) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Item<'a>> for Expr<'a>

Source§

fn from(original: Item<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Keyword<'a>> for Expr<'a>

Source§

fn from(original: Keyword<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<LatexEnv<'a>> for Expr<'a>

Source§

fn from(original: LatexEnv<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<LatexFragment<'a>> for Expr<'a>

Source§

fn from(original: LatexFragment<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<MacroCall<'a>> for Expr<'a>

Source§

fn from(original: MacroCall<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<MacroDef<'a>> for Expr<'a>

Source§

fn from(original: MacroDef<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Paragraph> for Expr<'a>

Source§

fn from(original: Paragraph) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<PlainLink<'a>> for Expr<'a>

Source§

fn from(original: PlainLink<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<PlainList> for Expr<'a>

Source§

fn from(original: PlainList) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<RegularLink<'a>> for Expr<'a>

Source§

fn from(original: RegularLink<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<StrikeThrough> for Expr<'a>

Source§

fn from(original: StrikeThrough) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Subscript<'a>> for Expr<'a>

Source§

fn from(original: Subscript<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Superscript<'a>> for Expr<'a>

Source§

fn from(original: Superscript<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Table> for Expr<'a>

Source§

fn from(original: Table) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<TableCell> for Expr<'a>

Source§

fn from(original: TableCell) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<TableRow> for Expr<'a>

Source§

fn from(original: TableRow) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Target<'a>> for Expr<'a>

Source§

fn from(original: Target<'a>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Underline> for Expr<'a>

Source§

fn from(original: Underline) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Vec<NodeID>> for Expr<'a>

Source§

fn from(original: Vec<NodeID>) -> Expr<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Verbatim<'a>> for Expr<'a>

Source§

fn from(original: Verbatim<'a>) -> Expr<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for Expr<'a>

§

impl<'a> RefUnwindSafe for Expr<'a>

§

impl<'a> Send for Expr<'a>

§

impl<'a> Sync for Expr<'a>

§

impl<'a> Unpin for Expr<'a>

§

impl<'a> UnwindSafe for Expr<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.