Skip to main content

Inline

Enum Inline 

Source
pub enum Inline {
Show 29 variants Text(Text), Escape(Escape), CharacterReference(CharacterReference), Emphasis(Emphasis), Strong(Strong), Underline(Underline), Delete(Delete), Insert(Insert), Mark(Mark), Subscript(Subscript), Superscript(Superscript), Spoiler(Spoiler), Shortcode(Shortcode), Code(CodeInline), Link(Link), Image(Image), LinkReference(LinkReference), ImageReference(ImageReference), Autolink(Autolink), Html(HtmlInline), SoftBreak(SoftBreak), LineBreak(LineBreak), Math(MathInline), FootnoteReference(FootnoteReference), InlineFootnote(InlineFootnote), WikiLink(WikiLink), MdxExpression(MdxExpressionInline), MdxJsx(MdxJsxInline), TextDirective(TextDirective),
}
Expand description

An inline-level node: the leaf and span content inside blocks.

Variants§

§

Text(Text)

Literal text.

§

Escape(Escape)

A backslash escape such as \*.

§

CharacterReference(CharacterReference)

A character reference such as & or ÷.

§

Emphasis(Emphasis)

Emphasis: *text* or _text_.

§

Strong(Strong)

Strong emphasis: **text** or __text__.

§

Underline(Underline)

Underline: __text__/___text___ (underscore extension).

§

Delete(Delete)

Strikethrough: ~~text~~.

§

Insert(Insert)

A CriticMarkup-style insertion: ++text++.

§

Mark(Mark)

A highlight / “mark” span: ==text==.

§

Subscript(Subscript)

Subscript: ~x~.

§

Superscript(Superscript)

Superscript: ^x^.

§

Spoiler(Spoiler)

A spoiler span: ||text||.

§

Shortcode(Shortcode)

An emoji-style shortcode: :name:.

§

Code(CodeInline)

An inline code span: `code`.

An inline link: [text](url).

§

Image(Image)

An inline image: ![alt](url).

§

LinkReference(LinkReference)

A reference link: [text][label].

§

ImageReference(ImageReference)

A reference image: ![alt][label].

An autolink: <url> or a GFM bare URL.

§

Html(HtmlInline)

Raw inline HTML such as <span>.

§

SoftBreak(SoftBreak)

A soft line break (a plain newline within a paragraph).

§

LineBreak(LineBreak)

A hard line break (\ or two trailing spaces).

§

Math(MathInline)

Inline math: $x$.

§

FootnoteReference(FootnoteReference)

A footnote reference: [^id].

§

InlineFootnote(InlineFootnote)

An inline footnote: ^[inline note].

A wiki link: [[target|label]].

§

MdxExpression(MdxExpressionInline)

An inline MDX expression: { … } (distinct from directives).

§

MdxJsx(MdxJsxInline)

An inline MDX JSX element (distinct from directives).

§

TextDirective(TextDirective)

A text directive: :name[label]{attrs} (distinct from MDX).

Implementations§

Source§

impl Inline

Source

pub fn meta(&self) -> &NodeMeta

Borrow this node’s NodeMeta.

Source

pub fn span(&self) -> Option<Span>

This node’s source span, if it carries one.

Source§

impl Inline

Source

pub fn children(&self) -> &[Inline]

The inline subtree of this node, or an empty slice for a leaf. Covers the alt/label fields uniformly, so a generic walker never silently skips an image’s alt text or a directive’s label.

Trait Implementations§

Source§

impl Clone for Inline

Source§

fn clone(&self) -> Inline

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Inline

Source§

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

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

impl Eq for Inline

Source§

impl From<Autolink> for Inline

Source§

fn from(node: Autolink) -> Self

Converts to this type from the input type.
Source§

impl From<CharacterReference> for Inline

Source§

fn from(node: CharacterReference) -> Self

Converts to this type from the input type.
Source§

impl From<CodeInline> for Inline

Source§

fn from(node: CodeInline) -> Self

Converts to this type from the input type.
Source§

impl From<Delete> for Inline

Source§

fn from(node: Delete) -> Self

Converts to this type from the input type.
Source§

impl From<Emphasis> for Inline

Source§

fn from(node: Emphasis) -> Self

Converts to this type from the input type.
Source§

impl From<Escape> for Inline

Source§

fn from(node: Escape) -> Self

Converts to this type from the input type.
Source§

impl From<FootnoteReference> for Inline

Source§

fn from(node: FootnoteReference) -> Self

Converts to this type from the input type.
Source§

impl From<HtmlInline> for Inline

Source§

fn from(node: HtmlInline) -> Self

Converts to this type from the input type.
Source§

impl From<Image> for Inline

Source§

fn from(node: Image) -> Self

Converts to this type from the input type.
Source§

impl From<ImageReference> for Inline

Source§

fn from(node: ImageReference) -> Self

Converts to this type from the input type.
Source§

impl From<InlineFootnote> for Inline

Source§

fn from(node: InlineFootnote) -> Self

Converts to this type from the input type.
Source§

impl From<Insert> for Inline

Source§

fn from(node: Insert) -> Self

Converts to this type from the input type.
Source§

impl From<LineBreak> for Inline

Source§

fn from(node: LineBreak) -> Self

Converts to this type from the input type.
Source§

impl From<Link> for Inline

Source§

fn from(node: Link) -> Self

Converts to this type from the input type.
Source§

impl From<LinkReference> for Inline

Source§

fn from(node: LinkReference) -> Self

Converts to this type from the input type.
Source§

impl From<Mark> for Inline

Source§

fn from(node: Mark) -> Self

Converts to this type from the input type.
Source§

impl From<MathInline> for Inline

Source§

fn from(node: MathInline) -> Self

Converts to this type from the input type.
Source§

impl From<MdxExpressionInline> for Inline

Source§

fn from(node: MdxExpressionInline) -> Self

Converts to this type from the input type.
Source§

impl From<MdxJsxInline> for Inline

Source§

fn from(node: MdxJsxInline) -> Self

Converts to this type from the input type.
Source§

impl From<Shortcode> for Inline

Source§

fn from(node: Shortcode) -> Self

Converts to this type from the input type.
Source§

impl From<SoftBreak> for Inline

Source§

fn from(node: SoftBreak) -> Self

Converts to this type from the input type.
Source§

impl From<Spoiler> for Inline

Source§

fn from(node: Spoiler) -> Self

Converts to this type from the input type.
Source§

impl From<Strong> for Inline

Source§

fn from(node: Strong) -> Self

Converts to this type from the input type.
Source§

impl From<Subscript> for Inline

Source§

fn from(node: Subscript) -> Self

Converts to this type from the input type.
Source§

impl From<Superscript> for Inline

Source§

fn from(node: Superscript) -> Self

Converts to this type from the input type.
Source§

impl From<Text> for Inline

Source§

fn from(node: Text) -> Self

Converts to this type from the input type.
Source§

impl From<TextDirective> for Inline

Source§

fn from(node: TextDirective) -> Self

Converts to this type from the input type.
Source§

impl From<Underline> for Inline

Source§

fn from(node: Underline) -> Self

Converts to this type from the input type.
Source§

impl From<WikiLink> for Inline

Source§

fn from(node: WikiLink) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Inline

Source§

fn eq(&self, other: &Inline) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Inline

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> 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.