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 Forget for Block
impl Freeze for Blockwhere
*const u8 is !null: Freeze,
PhantomData<Span>: Freeze,
PhantomData<Vec<Block>>: Freeze,
PhantomData<Inline>: Freeze,
PhantomData<Row>: Freeze,
PhantomData<u8>: Freeze,
impl Move for Block
impl RefUnwindSafe for Block
impl Send for Blockwhere
RawVecInner: Send,
impl Sync for Blockwhere
RawVecInner: Sync,
impl Unpin for Block
impl UnsafeUnpin for Blockwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Span>: UnsafeUnpin,
PhantomData<Vec<Block>>: UnsafeUnpin,
PhantomData<Inline>: UnsafeUnpin,
PhantomData<Row>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for Blockwhere
RawVecInner: UnwindSafe,
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