#[non_exhaustive]pub enum Event {
Show 40 variants
EndBlockQuote,
EndCaption,
EndDefinitionDetail,
EndDefinitionList,
EndDefinitionTerm,
EndDocument,
EndFootnote,
EndHeading,
EndLink,
EndOrderedListItem,
EndParagraph,
EndPreformatted,
EndTable,
EndTableCell,
EndTableHeader,
EndTableRow,
EndUnorderedListItem,
FootnoteRef {
id: u32,
},
Image {
alt: Option<String>,
decorative: bool,
id: Option<String>,
source: ImageSource,
title: Option<String>,
},
LineBreak,
SoftBreak,
StartBlockQuote {
id: Option<String>,
},
StartCaption {
id: Option<String>,
},
StartDefinitionDetail {
id: Option<String>,
},
StartDefinitionList {
id: Option<String>,
},
StartDefinitionTerm {
id: Option<String>,
},
StartDocument {
id: Option<String>,
language: Option<String>,
metadata: Option<DocumentMeta>,
},
StartFootnote {
id: u32,
},
StartHeading {
id: Option<String>,
level: u8,
},
StartLink {
href: String,
id: Option<String>,
title: Option<String>,
},
StartOrderedListItem {
id: Option<String>,
level: u32,
start: Option<u64>,
style_type: ListStyleType,
},
StartParagraph {
alignment: Option<TextAlignment>,
id: Option<String>,
},
StartPreformatted {
id: Option<String>,
syntax: Option<String>,
},
StartTable {
id: Option<String>,
},
StartTableCell {
colspan: Option<u32>,
id: Option<String>,
rowspan: Option<u32>,
},
StartTableHeader {
abbr: Option<String>,
colspan: Option<u32>,
id: Option<String>,
rowspan: Option<u32>,
scope: Option<TableHeaderScope>,
},
StartTableRow {
id: Option<String>,
},
StartUnorderedListItem {
id: Option<String>,
level: u32,
style_type: ListStyleType,
},
Text {
content: String,
style: TextStyle,
},
ThematicBreak {
id: Option<String>,
},
}Expand description
A streaming document event.
Events flow from crate::EventSource readers to crate::EventSink writers. The enum is
marked #[non_exhaustive] to allow adding new event types in future versions.
Events come in three categories:
- Start/End pairs: Container elements like headings, paragraphs, tables
- Self-contained: Standalone elements like text, images, line breaks
- Block vs Inline: Block events create new vertical sections; inline events flow within blocks
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EndBlockQuote
End a block quote.
EndCaption
End a table caption.
EndDefinitionDetail
End a definition detail.
EndDefinitionList
End a definition list.
EndDefinitionTerm
End a definition term.
EndDocument
End a document.
EndFootnote
End a footnote definition.
EndHeading
End a heading.
EndLink
End a hyperlink.
EndOrderedListItem
End an ordered (numbered) list item.
EndParagraph
End a paragraph.
EndPreformatted
End a preformatted block.
EndTable
End a table.
EndTableCell
End a table data cell.
EndTableHeader
End a table header cell.
EndTableRow
End a table row.
EndUnorderedListItem
End an unordered (bulleted) list item.
FootnoteRef
A reference to a footnote.
Image
An image reference.
Fields
source: ImageSourceSource of the image (embedded asset or external URI).
LineBreak
A hard line break within a paragraph.
SoftBreak
A soft line break in source markup, such as a markdown line wrap.
Soft breaks correspond to source line wraps that do not enforce a
visible break. Writers choose rendering policy: space, newline,
<br>, etc.
StartBlockQuote
Begin a block quote.
StartCaption
Begin a table caption.
StartDefinitionDetail
Begin a definition detail (description).
StartDefinitionList
Begin a definition list.
StartDefinitionTerm
Begin a definition term.
StartDocument
Begin a document with optional language and metadata.
Fields
metadata: Option<DocumentMeta>Document metadata including title, authors, and description.
StartFootnote
Begin a footnote definition.
StartHeading
Begin a heading of the given level.
Fields
StartLink
Begin a hyperlink.
Fields
StartOrderedListItem
Begin an ordered (numbered) list item.
Fields
start: Option<u64>Starting number for the list, populated only on the first item of an ordered list
(subsequent items in the same list: None).
style_type: ListStyleTypeVisual style of the list marker. Writers tolerate mismatches per ListStyleType convention.
StartParagraph
Begin a paragraph with optional alignment.
Fields
alignment: Option<TextAlignment>Text alignment for the paragraph.
StartPreformatted
Begin a preformatted (code) block with optional syntax highlighting.
Fields
StartTable
Begin a table.
StartTableCell
Begin a table data cell.
Fields
StartTableHeader
Begin a table header cell.
Fields
scope: Option<TableHeaderScope>Whether this header applies to a column or row.
StartTableRow
Begin a table row.
StartUnorderedListItem
Begin an unordered (bulleted) list item.
Fields
style_type: ListStyleTypeVisual style of the list marker. Writers tolerate mismatches per ListStyleType convention.
Text
A text run with formatting attributes.
ThematicBreak
A horizontal rule / thematic break.