pub trait Query {
// 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 { ... }
}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
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.