pub enum DocumentBlock {
Heading {
id: String,
level: u8,
text: String,
source: Option<SourceSpan>,
annotations: Vec<AnnotationRef>,
},
Paragraph {
id: String,
text: String,
source: Option<SourceSpan>,
annotations: Vec<AnnotationRef>,
},
List {
id: String,
text: String,
source: Option<SourceSpan>,
annotations: Vec<AnnotationRef>,
},
CodeBlock {
id: String,
language: Option<String>,
text: String,
source: Option<SourceSpan>,
annotations: Vec<AnnotationRef>,
},
Quote {
id: String,
text: String,
source: Option<SourceSpan>,
annotations: Vec<AnnotationRef>,
},
MathBlock {
id: String,
text: String,
source: Option<SourceSpan>,
},
TableRef {
id: String,
placement: TablePlacement,
source: Option<SourceSpan>,
},
ImageRef {
id: String,
placement: ImagePlacement,
source: Option<SourceSpan>,
},
}Expand description
A canonical document block.
Variants§
Heading
Markdown heading.
Fields
§
source: Option<SourceSpan>Source span when available.
§
annotations: Vec<AnnotationRef>Inline annotation markers in this block.
Paragraph
Markdown paragraph.
Fields
§
source: Option<SourceSpan>Source span when available.
§
annotations: Vec<AnnotationRef>Inline annotation markers in this block.
List
Markdown list.
Fields
§
source: Option<SourceSpan>Source span when available.
§
annotations: Vec<AnnotationRef>Inline annotation markers in this block.
CodeBlock
Markdown code block.
Fields
§
source: Option<SourceSpan>Source span when available.
§
annotations: Vec<AnnotationRef>Inline annotation markers in this block.
Quote
Markdown block quote.
Fields
§
source: Option<SourceSpan>Source span when available.
§
annotations: Vec<AnnotationRef>Inline annotation markers in this block.
MathBlock
Markdown display math block.
Fields
§
source: Option<SourceSpan>Source span when available.
TableRef
MCD table placement.
Fields
§
placement: TablePlacementParsed table placement.
§
source: Option<SourceSpan>Source span when available.
ImageRef
MCD image placement.
Fields
§
placement: ImagePlacementParsed image placement.
§
source: Option<SourceSpan>Source span when available.
Implementations§
Source§impl DocumentBlock
impl DocumentBlock
Sourcepub fn annotation_refs(&self) -> &[AnnotationRef]
pub fn annotation_refs(&self) -> &[AnnotationRef]
Return annotation refs attached to the block.
Trait Implementations§
Source§impl Clone for DocumentBlock
impl Clone for DocumentBlock
Source§impl Debug for DocumentBlock
impl Debug for DocumentBlock
Source§impl<'de> Deserialize<'de> for DocumentBlock
impl<'de> Deserialize<'de> for DocumentBlock
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 Eq for DocumentBlock
Source§impl PartialEq for DocumentBlock
impl PartialEq for DocumentBlock
Source§impl Serialize for DocumentBlock
impl Serialize for DocumentBlock
impl StructuralPartialEq for DocumentBlock
Auto Trait Implementations§
impl Freeze for DocumentBlock
impl RefUnwindSafe for DocumentBlock
impl Send for DocumentBlock
impl Sync for DocumentBlock
impl Unpin for DocumentBlock
impl UnsafeUnpin for DocumentBlock
impl UnwindSafe for DocumentBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.