pub struct Document {
pub blocks: Vec<Block>,
}Expand description
Root of a Markdown document
Fields§
§blocks: Vec<Block>Top‑level block sequence in document order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
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
Source§impl ExpandWith for Document
impl ExpandWith for Document
Source§fn expand_with<T: Transformer>(self, transformer: &mut T) -> Vec<Self>
fn expand_with<T: Transformer>(self, transformer: &mut T) -> Vec<Self>
Apply an expandable transformer to this AST node, returning multiple nodes
Source§impl FilterTransform for Document
impl FilterTransform for Document
Source§fn remove_empty_paragraphs(self) -> Self
fn remove_empty_paragraphs(self) -> Self
Remove empty paragraphs
Source§fn remove_empty_text(self) -> Self
fn remove_empty_text(self) -> Self
Remove empty text elements
Source§fn normalize_whitespace(self) -> Self
fn normalize_whitespace(self) -> Self
Normalize whitespace in text elements
Source§impl Query for Document
impl Query for Document
Source§fn find_all_inlines<F>(&self, predicate: F) -> Vec<&Inline>
fn find_all_inlines<F>(&self, predicate: F) -> Vec<&Inline>
Find all inline elements matching a predicate
Source§fn find_all_blocks<F>(&self, predicate: F) -> Vec<&Block>
fn find_all_blocks<F>(&self, predicate: F) -> Vec<&Block>
Find all block elements matching a predicate
Source§fn find_first_inline<F>(&self, predicate: F) -> Option<&Inline>
fn find_first_inline<F>(&self, predicate: F) -> Option<&Inline>
Find the first inline element matching a predicate
Source§fn find_first_block<F>(&self, predicate: F) -> Option<&Block>
fn find_first_block<F>(&self, predicate: F) -> Option<&Block>
Find the first block element matching a predicate
Source§fn count_inlines<F>(&self, predicate: F) -> usize
fn count_inlines<F>(&self, predicate: F) -> usize
Count inline elements matching a predicate
Source§fn count_blocks<F>(&self, predicate: F) -> usize
fn count_blocks<F>(&self, predicate: F) -> usize
Count block elements matching a predicate
Source§fn any_inline<F>(&self, predicate: F) -> bool
fn any_inline<F>(&self, predicate: F) -> bool
Check if any inline element matches a predicate
Source§fn find_all_links(&self) -> Vec<&Link>
fn find_all_links(&self) -> Vec<&Link>
Find all links in the document
Source§fn find_all_images(&self) -> Vec<&Image>
fn find_all_images(&self) -> Vec<&Image>
Find all images in the document
Source§fn find_all_headings(&self) -> Vec<&Heading>
fn find_all_headings(&self) -> Vec<&Heading>
Find all headings in the document
Source§fn find_all_autolinks(&self) -> Vec<&str>
fn find_all_autolinks(&self) -> Vec<&str>
Find all autolinks in the document
Source§fn find_all_text(&self) -> Vec<&str>
fn find_all_text(&self) -> Vec<&str>
Find all text nodes in the document
Source§fn find_all_code_spans(&self) -> Vec<&str>
fn find_all_code_spans(&self) -> Vec<&str>
Find all code spans in the document
Source§fn find_all_code_blocks(&self) -> Vec<&CodeBlock>
fn find_all_code_blocks(&self) -> Vec<&CodeBlock>
Find all code blocks in the document
Source§fn find_all_tables(&self) -> Vec<&Table>
fn find_all_tables(&self) -> Vec<&Table>
Find all tables in the document
Source§fn find_all_lists(&self) -> Vec<&List>
fn find_all_lists(&self) -> Vec<&List>
Find all lists in the document
Source§impl Transform for Document
impl Transform for Document
Source§fn transform_text<F>(self, f: F) -> Self
fn transform_text<F>(self, f: F) -> Self
Transform all text elements with a function Read more
Source§fn transform_image_urls<F>(self, f: F) -> Self
fn transform_image_urls<F>(self, f: F) -> Self
Transform all image URLs with a function Read more
Source§fn transform_link_urls<F>(self, f: F) -> Self
fn transform_link_urls<F>(self, f: F) -> Self
Transform all link URLs with a function Read more
Source§fn transform_autolink_urls<F>(self, f: F) -> Self
fn transform_autolink_urls<F>(self, f: F) -> Self
Transform all autolink URLs with a function
Source§fn transform_code<F>(self, f: F) -> Self
fn transform_code<F>(self, f: F) -> Self
Transform all code spans with a function
Source§fn transform_html<F>(self, f: F) -> Self
fn transform_html<F>(self, f: F) -> Self
Transform all HTML content with a function
Source§fn transform_with<T: Transformer>(self, transformer: T) -> Self
fn transform_with<T: Transformer>(self, transformer: T) -> Self
Apply a custom transformer
Source§impl TransformWith for Document
impl TransformWith for Document
Source§fn transform_with<T: Transformer>(self, transformer: &mut T) -> Self
fn transform_with<T: Transformer>(self, transformer: &mut T) -> Self
Apply a transformer to this AST node
Source§impl VisitWith for Document
impl VisitWith for Document
Source§fn visit_with<V: Visitor>(&self, visitor: &mut V)
fn visit_with<V: Visitor>(&self, visitor: &mut V)
Apply a visitor to this AST node
Source§impl<T: Default> WithData<T> for Document
impl<T: Default> WithData<T> for Document
Source§type WithDataType = Document<T>
type WithDataType = Document<T>
The type with user data attached
Source§fn with_data(self, data: T) -> Self::WithDataType
fn with_data(self, data: T) -> Self::WithDataType
Add user data to this AST node
Source§fn with_default_data(self) -> Self::WithDataTypewhere
T: Default,
fn with_default_data(self) -> Self::WithDataTypewhere
T: Default,
Add default user data to this AST node
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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