Block

Enum Block 

Source
pub enum Block {
    Paragraph(Vec<Inline>),
    Heading {
        level: u8,
        content: Vec<Inline>,
    },
    CodeBlock {
        language: Option<String>,
        content: String,
    },
    Blockquote(Vec<Block>),
    List {
        ordered: bool,
        items: Vec<Block>,
    },
    TaskList {
        items: Vec<(bool, Block)>,
    },
    Table {
        headers: Vec<Inline>,
        rows: Vec<Vec<Inline>>,
        alignments: Vec<Alignment>,
    },
    Image {
        alt: String,
        url: String,
    },
    HorizontalRule,
    BlockList(Vec<Block>),
}
Expand description

Document-level nodes describing paragraphs, lists, and other structural items.

Variants§

§

Paragraph(Vec<Inline>)

A paragraph of inline elements.

§

Heading

A heading with a specific level and inline content.

Fields

§level: u8
§content: Vec<Inline>
§

CodeBlock

A fenced code block with an optional language tag.

Fields

§language: Option<String>
§content: String
§

Blockquote(Vec<Block>)

A nested collection of quoted blocks.

§

List

An ordered or unordered list of blocks.

Fields

§ordered: bool
§items: Vec<Block>
§

TaskList

A list of checkbox items paired with their content.

Fields

§items: Vec<(bool, Block)>
§

Table

A table with headers, rows, and column alignments.

Fields

§headers: Vec<Inline>
§rows: Vec<Vec<Inline>>
§alignments: Vec<Alignment>
§

Image

A standalone image block.

Fields

§

HorizontalRule

A thematic break separating sections.

§

BlockList(Vec<Block>)

A container that renders nested blocks in sequence.

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Block

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 Debug for Block

Source§

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

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

impl<T> From<T> for Block
where T: Into<Inline>,

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl Hash for Block

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, __T> IntoItems<Block> for &'a [__T]
where Block: From<&'a __T>,

Source§

type IntoIter = Map<Iter<'a, __T>, fn(&'a __T) -> Block>

Source§

fn into_items(self) -> Self::IntoIter

Source§

impl<const __N: usize, __T> IntoItems<Block> for [__T; __N]
where Block: From<__T>,

Source§

type IntoIter = Map<IntoIter<__T, __N>, fn(__T) -> Block>

Source§

fn into_items(self) -> Self::IntoIter

Source§

impl<__A0> IntoItems<Block> for (__A0,)
where Block: From<__A0>,

Source§

impl<__A0, __A1> IntoItems<Block> for (__A0, __A1)
where Block: From<__A0> + From<__A1>,

Source§

impl<__A0, __A1, __A2> IntoItems<Block> for (__A0, __A1, __A2)
where Block: From<__A0> + From<__A1> + From<__A2>,

Source§

impl<__A0, __A1, __A2, __A3> IntoItems<Block> for (__A0, __A1, __A2, __A3)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3>,

Source§

impl<__A0, __A1, __A2, __A3, __A4> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6> + From<__A7>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6> + From<__A7> + From<__A8>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6> + From<__A7> + From<__A8> + From<__A9>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6> + From<__A7> + From<__A8> + From<__A9> + From<__A10>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10, __A11> IntoItems<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10, __A11)
where Block: From<__A0> + From<__A1> + From<__A2> + From<__A3> + From<__A4> + From<__A5> + From<__A6> + From<__A7> + From<__A8> + From<__A9> + From<__A10> + From<__A11>,

Source§

impl IntoItems<Block> for Block
where Block: From<Block>,

Source§

impl IntoItems<Block> for Inline
where Block: From<Inline>,

Source§

impl<__T> IntoItems<Block> for Vec<__T>
where Block: From<__T>,

Source§

type IntoIter = Map<IntoIter<__T>, fn(__T) -> Block>

Source§

fn into_items(self) -> Self::IntoIter

Source§

impl<'a, __T> IntoRows<Block> for &'a [__T]

Source§

impl<const __N: usize, __T> IntoRows<Block> for [__T; __N]
where __T: IntoItems<Block>,

Source§

type RowIter = <__T as IntoItems<Block>>::IntoIter

Source§

type Rows = Map<IntoIter<__T, __N>, fn(__T) -> <__T as IntoItems<Block>>::IntoIter>

Source§

fn into_rows(self) -> Self::Rows

Source§

impl<__A0> IntoRows<Block> for (__A0,)
where __A0: IntoItems<Block>,

Source§

impl<__A0, __A1> IntoRows<Block> for (__A0, __A1)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2> IntoRows<Block> for (__A0, __A1, __A2)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3> IntoRows<Block> for (__A0, __A1, __A2, __A3)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>, __A7: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>, __A7: IntoItems<Block>, __A8: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>, __A7: IntoItems<Block>, __A8: IntoItems<Block>, __A9: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>, __A7: IntoItems<Block>, __A8: IntoItems<Block>, __A9: IntoItems<Block>, __A10: IntoItems<Block>,

Source§

impl<__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10, __A11> IntoRows<Block> for (__A0, __A1, __A2, __A3, __A4, __A5, __A6, __A7, __A8, __A9, __A10, __A11)
where __A0: IntoItems<Block>, __A1: IntoItems<Block>, __A2: IntoItems<Block>, __A3: IntoItems<Block>, __A4: IntoItems<Block>, __A5: IntoItems<Block>, __A6: IntoItems<Block>, __A7: IntoItems<Block>, __A8: IntoItems<Block>, __A9: IntoItems<Block>, __A10: IntoItems<Block>, __A11: IntoItems<Block>,

Source§

impl<__T> IntoRows<Block> for Vec<__T>
where __T: IntoItems<Block>,

Source§

type RowIter = <__T as IntoItems<Block>>::IntoIter

Source§

type Rows = Map<IntoIter<__T>, fn(__T) -> <__T as IntoItems<Block>>::IntoIter>

Source§

fn into_rows(self) -> Self::Rows

Source§

impl PartialEq for Block

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<R: Render> Renderable<R> for Block

Source§

type Output = <R as Render>::Output

Source§

fn render_with(&self, renderer: &mut R) -> Self::Output

Render self with the provided renderer, producing an output value.
Source§

impl Eq for Block

Source§

impl StructuralPartialEq for Block

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnwindSafe for Block

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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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.