Enum jotdown::Container

source ·
pub enum Container<'s> {
Show 31 variants Blockquote, List { kind: ListKind, tight: bool, }, ListItem, TaskListItem { checked: bool, }, DescriptionList, DescriptionDetails, Footnote { tag: &'s str, number: usize, }, Table, TableRow { head: bool, }, Section { id: Cow<'s, str>, }, Div { class: Option<&'s str>, }, Paragraph, Heading { level: u16, has_section: bool, id: Cow<'s, str>, }, TableCell { alignment: Alignment, head: bool, }, Caption, DescriptionTerm, RawBlock { format: &'s str, }, CodeBlock { lang: Option<&'s str>, }, Span, Link(Cow<'s, str>, LinkType), Image(Cow<'s, str>, SpanLinkType), Verbatim, Math { display: bool, }, RawInline { format: &'s str, }, Subscript, Superscript, Insert, Delete, Strong, Emphasis, Mark,
}
Expand description

A container that may contain other elements.

There are three types of containers:

  • inline, may only contain inline elements,
  • block leaf, may only contain inline elements,
  • block container, may contain any block-level elements.

Variants§

§

Blockquote

A blockquote element.

§

List

Fields

§tight: bool

A list.

§

ListItem

An item of a list

§

TaskListItem

Fields

§checked: bool

An item of a task list, either checked or unchecked.

§

DescriptionList

A description list element.

§

DescriptionDetails

Details describing a term within a description list.

§

Footnote

Fields

§tag: &'s str
§number: usize

A footnote definition.

§

Table

A table element.

§

TableRow

Fields

§head: bool

A row element of a table.

§

Section

Fields

§id: Cow<'s, str>

A section belonging to a top level heading.

§

Div

Fields

§class: Option<&'s str>

A block-level divider element.

§

Paragraph

A paragraph.

§

Heading

Fields

§level: u16
§has_section: bool
§id: Cow<'s, str>

A heading.

§

TableCell

Fields

§alignment: Alignment
§head: bool

A cell element of row within a table.

§

Caption

A caption within a table.

§

DescriptionTerm

A term within a description list.

§

RawBlock

Fields

§format: &'s str

A block with raw markup for a specific output format.

§

CodeBlock

Fields

§lang: Option<&'s str>

A block with code in a specific language.

§

Span

An inline divider element.

An inline link with a destination URL.

§

Image(Cow<'s, str>, SpanLinkType)

An inline image with a source URL. Inner Str objects compose the alternative text.

§

Verbatim

An inline verbatim string.

§

Math

Fields

§display: bool

An inline or display math element.

§

RawInline

Fields

§format: &'s str

Inline raw markup for a specific output format.

§

Subscript

A subscripted element.

§

Superscript

A superscripted element.

§

Insert

An inserted inline element.

§

Delete

A deleted inline element.

§

Strong

An inline element emphasized with a bold typeface.

§

Emphasis

An emphasized inline element.

§

Mark

A highlighted inline element.

Trait Implementations§

source§

impl<'s> Debug for Container<'s>

source§

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

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

impl<'s> PartialEq<Container<'s>> for Container<'s>

source§

fn eq(&self, other: &Container<'s>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> Eq for Container<'s>

source§

impl<'s> StructuralEq for Container<'s>

source§

impl<'s> StructuralPartialEq for Container<'s>

Auto Trait Implementations§

§

impl<'s> RefUnwindSafe for Container<'s>

§

impl<'s> Send for Container<'s>

§

impl<'s> Sync for Container<'s>

§

impl<'s> Unpin for Container<'s>

§

impl<'s> UnwindSafe for Container<'s>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.