pub enum Block {
Heading {
level: u8,
text: Inline,
},
Paragraph {
text: Inline,
},
List {
ordered: bool,
items: Vec<Vec<Block>>,
},
Table {
header: Option<Row>,
rows: Vec<Row>,
},
Code {
lang: Option<String>,
text: String,
},
Image {
alt: Option<String>,
},
PageBreak {
page: u32,
},
}Expand description
A block-level element.
Paragraph is a struct variant rather than the newtype the plan sketches:
serde’s internally-tagged representation cannot tag a newtype wrapping a
sequence, and Inline is transparent over Vec<Span>.
Variants§
Heading
Paragraph
List
Table
Code
Image
Images carry alt text only — DeepDoc never extracts pixels (that is DeepThumb).
PageBreak
Page boundary marker; page is the number of the page that starts here.
Implementations§
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more