#[non_exhaustive]pub enum Block {
#[non_exhaustive] Text {
content: String,
footnotes: Vec<Footnote>,
},
#[non_exhaustive] Quote {
content: String,
footnotes: Vec<Footnote>,
},
#[non_exhaustive] Title {
content: String,
footnotes: Vec<Footnote>,
level: usize,
},
#[non_exhaustive] Image {
url: PathBuf,
alt: Option<String>,
caption: Option<String>,
footnotes: Vec<Footnote>,
},
#[non_exhaustive] Audio {
url: PathBuf,
fallback: String,
caption: Option<String>,
footnotes: Vec<Footnote>,
},
#[non_exhaustive] Video {
url: PathBuf,
fallback: String,
caption: Option<String>,
footnotes: Vec<Footnote>,
},
#[non_exhaustive] MathML {
element_str: String,
fallback_image: Option<PathBuf>,
caption: Option<String>,
footnotes: Vec<Footnote>,
},
}Expand description
Content Block
The content block is the basic unit of content in a content document. It can be one of the following types: Text, Quote, Title, Image, Audio, Video, MathML.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
#[non_exhaustive]Text
Text paragraph
This block represents a paragraph of text.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Quote
Quote paragraph
This block represents a paragraph of quoted text.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Title
Heading
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Image
Image block
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Audio
Audio block
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Video
Video block
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]MathML
MathML block
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
element_str: StringMathML element raw data
This field stores the raw data of the MathML markup, which we do not verify, and the user needs to make sure it is correct.
Implementations§
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 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