pub struct Filter<'a> { /* private fields */ }Expand description
Collection of node-matching predicates the find and count walks
apply to each node they visit.
Implementations§
Source§impl Filter<'_>
impl Filter<'_>
Sourcepub fn any<'t>(&self, node: &Node<'t>, ancestors: Ancestors<'t, '_>) -> bool
pub fn any<'t>(&self, node: &Node<'t>, ancestors: Ancestors<'t, '_>) -> bool
Returns true if any of the configured predicates matches
node, reached through ancestors.
A walker that maintains an ancestor chain should pass it. The
"function" and "string" predicates ask about an enclosing
construct, and off Ancestors::unknown each such lookup is
Node::parent’s O(depth) — which made count --type string
quadratic in nesting depth until find and count threaded a
real chain (#1381).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Filter<'a>
impl<'a> !Send for Filter<'a>
impl<'a> !Sync for Filter<'a>
impl<'a> !UnwindSafe for Filter<'a>
impl<'a> Freeze for Filter<'a>
impl<'a> Unpin for Filter<'a>
impl<'a> UnsafeUnpin for Filter<'a>
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