pub enum Block {
Heading {
id: NodeId,
level: HeadingLevel,
inlines: Vec<Inline>,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
Paragraph {
id: NodeId,
inlines: Vec<Inline>,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
Blockquote {
id: NodeId,
blocks: Vec<Block>,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
CodeBlock {
id: NodeId,
info: Option<String>,
text: String,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
ThematicBreak {
id: NodeId,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
PageBreak {
id: NodeId,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
ColumnBreak {
id: NodeId,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
Image {
id: NodeId,
url: String,
alt: String,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
List {
id: NodeId,
ordered: bool,
start: u32,
tight: bool,
items: Vec<ListItem>,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
Table {
id: NodeId,
head: Vec<Row>,
body: Vec<Row>,
attributes: Attributes,
position: Option<SourcePos>,
span: Option<SourceSpan>,
},
}Expand description
A block-level element: the unit of fragmentation input.
Variants§
Heading
# through ######; levels outside 1–6 are rejected at parse.
Fields
level: HeadingLevel# count, 1-6.
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
Paragraph
A run of prose: the unit line layout breaks.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
Blockquote
A quotation set off by >; contents are blocks, not inlines —
blockquotes nest.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
CodeBlock
A code block: preformatted text, set as it was written.
It holds text rather than inlines, because a code block has no markup inside it. The text keeps the newlines and the spaces the author wrote, and those are what its lines break at.
Fields
info: Option<String>The word after the opening fence, where one was written. It is carried for a painter that reads it, and the engine makes nothing of it.
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
ThematicBreak
---: a scene break, rendered as space or an ornament (❦).
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
PageBreak
\pagebreak: what follows it starts a new page. It holds no
text and takes no height.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
ColumnBreak
\columnbreak: what follows it starts the next column. It
holds no text and takes no height.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
Image
A block-level image.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
List
A list of items, numbered or not. An item holds blocks, as a blockquote does, so a list nests inside an item of another.
Fields
tight: boolWhether the source wrote the items without blank lines between them: a list of phrases rather than a list of paragraphs.
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
Table
A grid of cells. A cell holds blocks, as a blockquote does.
Fields
attributes: AttributesWhat a sheet names it by.
span: Option<SourceSpan>The bytes of that source it was read from.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.