Enum Content

Source
pub enum Content<'src> {
Show 26 variants Basic(Span<'src>), Sequence { source: Span<'src>, children: Vec<Content<'src>>, }, NamedCharacterLt(Span<'src>), NamedCharacterGt(Span<'src>), NamedCharacterAmp(Span<'src>), Emphasis { source: Span<'src>, content: Box<Content<'src>>, }, Strong { source: Span<'src>, content: Box<Content<'src>>, }, Monospace { source: Span<'src>, content: Box<Content<'src>>, }, Superscript { source: Span<'src>, content: Box<Content<'src>>, }, Subscript { source: Span<'src>, content: Box<Content<'src>>, }, DoubleCurvedQuotes { source: Span<'src>, content: Box<Content<'src>>, }, SingleCurvedQuotes { source: Span<'src>, content: Box<Content<'src>>, }, AttributeValue { source: Span<'src>, value: Box<Content<'src>>, }, TextSymbolCopyright(Span<'src>), TextSymbolRegistered(Span<'src>), TextSymbolTrademark(Span<'src>), TextSymbolEmDash(Span<'src>), TextSymbolEllipsis(Span<'src>), TextSymbolSingleRightArrow(Span<'src>), TextSymbolDoubleRightArrow(Span<'src>), TextSymbolSingleLeftArrow(Span<'src>), TextSymbolDoubleLeftArrow(Span<'src>), TextSymbolTypographicApostrophe(Span<'src>), CharacterReference { source: Span<'src>, value: char, }, Macro { source: Span<'src>, content: Box<Content<'src>>, }, LineBreak(Span<'src>),
}
Expand description

Describes the annotated content of a Span after any relevant substitutions have been performed.

This is typically used to represent the main body of block types that don’t contain other blocks, such as SimpleBlock or RawDelimitedBlock.

Variants§

§

Basic(Span<'src>)

The content of this Span should be passed through without further interpretation.

§

Sequence

Represents a series of Content items of varying types.

Fields

§source: Span<'src>

The source for the overall sequence of Content items.

§children: Vec<Content<'src>>

The sequence of Content items.

§

NamedCharacterLt(Span<'src>)

The less-than symbol, <, is replaced (in HTML output) with the named character reference &lt;.

§

NamedCharacterGt(Span<'src>)

The greater-than symbol, >, is replaced (in HTML output) with the named character reference &gt;.

§

NamedCharacterAmp(Span<'src>)

An ampersand, &, is replaced with the named character reference &amp;.

§

Emphasis

Content wrapped with underscores (e.g., _word_) are wrapped (in HTML output) in an <em> tag.

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be emphasized.

§

Strong

Content wrapped with asterisks (e.g., *word*) are wrapped (in HTML output) in a <strong> tag.

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be emphasized.

§

Monospace

Content wrapped with backticks (e.g., `word`) are wrapped (in HTML output) in a <code> tag.

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be monospaced.

§

Superscript

Content wrapped with up arrows (e.g., ^word^) are wrapped (in HTML output) in a <sup> tag.

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be superscripted.

§

Subscript

Content wrapped with tildes (e.g., ~word~) are wrapped (in HTML output) in a <sub> tag.

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be subscripted.

§

DoubleCurvedQuotes

Content wrapped with a double quote and backtick (e.g., "`word`") are wrapped (in HTML output) in a double curved quote pair (i.e. &#8220;word&#8221;).

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be quote-wrapped.

§

SingleCurvedQuotes

Content wrapped with a single quote and backtick (e.g., '`word`') are wrapped (in HTML output) in single curved quote pair (i.e. &#8216;word&#8217;).

Fields

§source: Span<'src>

The source for the overall quote sequence.

§content: Box<Content<'src>>

Content to be quote-wrapped.

§

AttributeValue

Attribute references are replaced with the values of the attribute they reference when processed by the attributes substitution step. Such values may be subject to further substitutions.

Fields

§source: Span<'src>

The source for the attribute substitution sequence.

§value: Box<Content<'src>>

Content of the attribute value after any subsequent substitutions.

§

TextSymbolCopyright(Span<'src>)

The character sequence (C) is replaced (in HTML output) with the named character reference &#169;.

§

TextSymbolRegistered(Span<'src>)

The character sequence (R) is replaced (in HTML output) with the named character reference &#174;.

§

TextSymbolTrademark(Span<'src>)

The character sequence (TM) is replaced (in HTML output) with the named character reference &#8482;.

§

TextSymbolEmDash(Span<'src>)

The character sequence -- is replaced (in HTML output) with the named character reference &#8212;, but only if between two word characters, between a word character and a line boundary, or flanked by spaces. When flanked by space characters (e.g., a -- b), the normal spaces are replaced by thin spaces (&#8201;). Otherwise, the em dash is followed by a zero-width space (&#8203;) to provide a break opportunity.

§

TextSymbolEllipsis(Span<'src>)

The character sequence ... is replaced (in HTML output) with the named character reference &#8430;. The ellipsis is followed by a zero-width space (&#8203;) to provide a break opportunity.

§

TextSymbolSingleRightArrow(Span<'src>)

The character sequence -> is replaced (in HTML output) with the named character reference &#8594;.

§

TextSymbolDoubleRightArrow(Span<'src>)

The character sequence => is replaced (in HTML output) with the named character reference &#8658;.

§

TextSymbolSingleLeftArrow(Span<'src>)

The character sequence <- is replaced (in HTML output) with the named character reference &#8592;.

§

TextSymbolDoubleLeftArrow(Span<'src>)

The character sequence <= is replaced (in HTML output) with the named character reference &#8656;.

§

TextSymbolTypographicApostrophe(Span<'src>)

The single typewriter apostrophe ' is replaced (in HTML output) with the named character reference &#8217;.

§

CharacterReference

HTML and XML character references and decimal and hexadecimal Unicode code points are replaced with their corresponding decimal form Unicode code point.

Fields

§source: Span<'src>

The source for the original character reference.

§value: char

The Unicode character to insert.

§

Macro

The content of any inline and block macro are replaced with the appropriate built-in and user-defined configuration.

Fields

§source: Span<'src>

The source for the original macro invocation.

§content: Box<Content<'src>>

Replacement content provided by the macro definition.

§

LineBreak(Span<'src>)

The line break character, +, is replaced with (what?).

Trait Implementations§

Source§

impl<'src> Clone for Content<'src>

Source§

fn clone(&self) -> Content<'src>

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

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

Performs copy-assignment from source. Read more
Source§

impl<'src> Debug for Content<'src>

Source§

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

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

impl<'src> From<Span<'src>> for Content<'src>

Source§

fn from(span: Span<'src>) -> Self

Converts to this type from the input type.
Source§

impl<'src> PartialEq for Content<'src>

Source§

fn eq(&self, other: &Content<'src>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const 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<'src> Eq for Content<'src>

Source§

impl<'src> StructuralPartialEq for Content<'src>

Auto Trait Implementations§

§

impl<'src> Freeze for Content<'src>

§

impl<'src> RefUnwindSafe for Content<'src>

§

impl<'src> Send for Content<'src>

§

impl<'src> Sync for Content<'src>

§

impl<'src> Unpin for Content<'src>

§

impl<'src> UnwindSafe for Content<'src>

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.