pub enum Block {
Show 15 variants
Paragraph(Vec<Inline>),
Heading {
level: u8,
content: Vec<Inline>,
},
Preformatted {
language: Option<String>,
text: String,
},
Footer(Vec<Inline>),
Divider,
MathBlock(String),
Anchor(String),
List {
ordered: bool,
start: Option<i64>,
items: Vec<ListItem>,
},
Quote {
blocks: Vec<Block>,
credit: Option<Vec<Inline>>,
},
ExpandableQuote {
content: Vec<Inline>,
credit: Option<Vec<Inline>>,
},
PullQuote {
content: Vec<Inline>,
credit: Option<Vec<Inline>>,
},
Media(Media),
Table(Table),
Details {
summary: Vec<Inline>,
blocks: Vec<Block>,
open: bool,
},
Buttons {
align: Option<Align>,
buttons: Vec<UrlButton>,
},
}Expand description
A block-level element.
Variants§
Paragraph(Vec<Inline>)
A text paragraph (<p>).
Heading
A section heading (<h1>–<h6>); level is clamped to 1..=6.
Preformatted
A preformatted block (<pre> / <pre><code class="language-…">).
Fields
A footer (<footer>).
Divider
A horizontal divider (<hr/>).
MathBlock(String)
A block formula (<tg-math-block>), raw LaTeX.
Anchor(String)
An anchor target (<a name="…"></a>).
List
An ordered or unordered list.
Fields
Quote
A block quotation (<blockquote>), may contain nested blocks.
ExpandableQuote
An expandable block quotation (<blockquote expandable>), inline content only.
Fields
§
content: Vec<Inline>Quoted content; use Inline::LineBreak for line breaks.
PullQuote
A pull quotation (<aside>).
Media(Media)
A standalone media element.
Table(Table)
A table; cells contain inline content only.
Details
A disclosure block (<details>).
Fields
Buttons
A row of URL buttons (<tg-button-row>), 1–8 buttons.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Forget for Block
impl Freeze for Block
impl Move 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