Skip to main content

Inline

Enum Inline 

Source
pub enum Inline {
Show 23 variants Text(Text), Escape(Escape), CharacterReference(CharacterReference), Emphasis(Emphasis), Strong(Strong), Delete(Delete), Mark(Mark), Shortcode(Shortcode), Code(CodeInline), Link(Link), Autolink(Autolink), Image(Image), LinkReference(LinkReference), ImageReference(ImageReference), Html(HtmlInline), SoftBreak(SoftBreak), LineBreak(LineBreak), Math(MathInline), FootnoteReference(FootnoteReference), InlineFootnote(InlineFootnote), WikiLink(WikiLink), TextDirective(TextDirective), Tag(Tag),
}
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__.

§

Delete(Delete)

Strikethrough: ~~text~~.

§

Mark(Mark)

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

§

Shortcode(Shortcode)

An emoji-style shortcode: :name:.

§

Code(CodeInline)

An inline code span: `code`.

An inline link: [text](url).

An autolink: <https://example.com> or a bare literal URL or email.

§

Image(Image)

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

§

LinkReference(LinkReference)

A reference link: [text][label].

§

ImageReference(ImageReference)

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

§

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

§

TextDirective(TextDirective)

A text directive: :name[label]{attrs}.

§

Tag(Tag)

A tag: #name.

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) -> Self

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<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<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<Strong> for Inline

Source§

fn from(node: Strong) -> Self

Converts to this type from the input type.
Source§

impl From<Tag> for Inline

Source§

fn from(node: Tag) -> 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<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: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.