pub trait Query {
Show 17 methods
// Required methods
fn find_all_inlines<F>(&self, predicate: F) -> Vec<&Inline>
where F: Fn(&Inline) -> bool;
fn find_all_blocks<F>(&self, predicate: F) -> Vec<&Block>
where F: Fn(&Block) -> bool;
fn find_first_inline<F>(&self, predicate: F) -> Option<&Inline>
where F: Fn(&Inline) -> bool;
fn find_first_block<F>(&self, predicate: F) -> Option<&Block>
where F: Fn(&Block) -> bool;
// Provided methods
fn count_inlines<F>(&self, predicate: F) -> usize
where F: Fn(&Inline) -> bool { ... }
fn count_blocks<F>(&self, predicate: F) -> usize
where F: Fn(&Block) -> bool { ... }
fn any_inline<F>(&self, predicate: F) -> bool
where F: Fn(&Inline) -> bool { ... }
fn any_block<F>(&self, predicate: F) -> bool
where F: Fn(&Block) -> bool { ... }
fn find_all_links(&self) -> Vec<&Link> { ... }
fn find_all_images(&self) -> Vec<&Image> { ... }
fn find_all_headings(&self) -> Vec<&Heading> { ... }
fn find_all_autolinks(&self) -> Vec<&str> { ... }
fn find_all_text(&self) -> Vec<&str> { ... }
fn find_all_code_spans(&self) -> Vec<&str> { ... }
fn find_all_code_blocks(&self) -> Vec<&CodeBlock> { ... }
fn find_all_tables(&self) -> Vec<&Table> { ... }
fn find_all_lists(&self) -> Vec<&List> { ... }
}Expand description
Query trait for finding elements in AST structures
Required Methods§
Sourcefn 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
Sourcefn 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
Sourcefn 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
Provided Methods§
Sourcefn count_inlines<F>(&self, predicate: F) -> usize
fn count_inlines<F>(&self, predicate: F) -> usize
Count inline elements matching a predicate
Sourcefn count_blocks<F>(&self, predicate: F) -> usize
fn count_blocks<F>(&self, predicate: F) -> usize
Count block elements matching a predicate
Sourcefn any_inline<F>(&self, predicate: F) -> bool
fn any_inline<F>(&self, predicate: F) -> bool
Check if any inline element matches a predicate
Sourcefn find_all_links(&self) -> Vec<&Link>
fn find_all_links(&self) -> Vec<&Link>
Find all links in the document
Sourcefn find_all_images(&self) -> Vec<&Image>
fn find_all_images(&self) -> Vec<&Image>
Find all images in the document
Sourcefn find_all_headings(&self) -> Vec<&Heading>
fn find_all_headings(&self) -> Vec<&Heading>
Find all headings in the document
Sourcefn find_all_autolinks(&self) -> Vec<&str>
fn find_all_autolinks(&self) -> Vec<&str>
Find all autolinks in the document
Sourcefn find_all_text(&self) -> Vec<&str>
fn find_all_text(&self) -> Vec<&str>
Find all text nodes in the document
Sourcefn find_all_code_spans(&self) -> Vec<&str>
fn find_all_code_spans(&self) -> Vec<&str>
Find all code spans in the document
Sourcefn find_all_code_blocks(&self) -> Vec<&CodeBlock>
fn find_all_code_blocks(&self) -> Vec<&CodeBlock>
Find all code blocks in the document
Sourcefn find_all_tables(&self) -> Vec<&Table>
fn find_all_tables(&self) -> Vec<&Table>
Find all tables in the document
Sourcefn find_all_lists(&self) -> Vec<&List>
fn find_all_lists(&self) -> Vec<&List>
Find all lists in the document
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.