pub enum ParsedElement {
Block(ParsedBlock),
Table(ParsedTable),
FootnoteDefinition {
label: String,
blocks: Vec<ParsedBlock>,
},
}Expand description
A parsed element: either a block or a table.
Variants§
Block(ParsedBlock)
Table(ParsedTable)
FootnoteDefinition
A footnote definition: the label its references name, and the blocks making up its body.
Separate from Block because a definition is not part of the flow it was
written in — it belongs wherever the output format puts notes, which the
importer expresses by giving it a detached frame of its own.
Implementations§
Source§impl ParsedElement
impl ParsedElement
Sourcepub fn flatten_to_blocks(elements: Vec<ParsedElement>) -> Vec<ParsedBlock>
pub fn flatten_to_blocks(elements: Vec<ParsedElement>) -> Vec<ParsedBlock>
Extract blocks, flattening tables into one block per cell. Use when table structure is not needed.
Trait Implementations§
Source§impl Clone for ParsedElement
impl Clone for ParsedElement
Source§fn clone(&self) -> ParsedElement
fn clone(&self) -> ParsedElement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedElement
impl RefUnwindSafe for ParsedElement
impl Send for ParsedElement
impl Sync for ParsedElement
impl Unpin for ParsedElement
impl UnsafeUnpin for ParsedElement
impl UnwindSafe for ParsedElement
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