pub trait Predicate {
fn matches(&self, node: &Node<'_>) -> bool;
fn or<T: Predicate>(self, other: T) -> Or<Self, T>
where
Self: Sized,
{ ... }
fn and<T: Predicate>(self, other: T) -> And<Self, T>
where
Self: Sized,
{ ... }
fn not(self) -> Not<Self>
where
Self: Sized,
{ ... }
fn child<T: Predicate>(self, other: T) -> Child<Self, T>
where
Self: Sized,
{ ... }
fn descendant<T: Predicate>(self, other: T) -> Descendant<Self, T>
where
Self: Sized,
{ ... }
}
Expand description
A trait implemented by all Node
matchers.
Required Methods§
Provided Methods§
fn or<T: Predicate>(self, other: T) -> Or<Self, T>where
Self: Sized,
fn and<T: Predicate>(self, other: T) -> And<Self, T>where
Self: Sized,
fn not(self) -> Not<Self>where
Self: Sized,
fn child<T: Predicate>(self, other: T) -> Child<Self, T>where
Self: Sized,
fn descendant<T: Predicate>(self, other: T) -> Descendant<Self, T>where
Self: Sized,
Implementors§
impl Predicate for Any
impl Predicate for Comment
impl Predicate for Element
impl Predicate for Text
impl<'a> Predicate for Attr<&'a str, &'a str>
impl<'a> Predicate for Attr<&'a str, ()>
impl<'a> Predicate for Class<&'a str>
impl<'a> Predicate for Name<&'a str>
impl<A: Predicate, B: Predicate> Predicate for And<A, B>
impl<A: Predicate, B: Predicate> Predicate for Child<A, B>
impl<A: Predicate, B: Predicate> Predicate for Descendant<A, B>
impl<A: Predicate, B: Predicate> Predicate for Or<A, B>
impl<F: Fn(&Node<'_>) -> bool> Predicate for F
Matches if the function returns true.