pub enum Block {
Heading {
level: u8,
text: StyledText,
},
Paragraph(StyledText),
Code {
language: Box<str>,
code: Box<str>,
},
Quote(Vec<Self>),
UnorderedList(Vec<ListItem>),
OrderedList {
start: u64,
items: Vec<ListItem>,
},
ThematicBreak,
Table(Box<TableData>),
Image {
url: Box<str>,
alt: Box<str>,
},
}Expand description
A single renderable block produced by parsing.
Large variants (Table) are boxed to keep the enum compact (~56 bytes
instead of ~72), improving cache locality during block iteration.
Immutable string fields use Box<str> to avoid the 8-byte capacity
overhead of String — these values are never modified after construction.
Variants§
Heading
Paragraph(StyledText)
Code
Fields
Quote(Vec<Self>)
UnorderedList(Vec<ListItem>)
OrderedList
ThematicBreak
Table(Box<TableData>)
Image
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl !Send for Block
impl !Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more