pub struct Query<'a, E: Extension + 'a> { /* private fields */ }
Expand description
A query on a node that can be used to look up nodes in the same way that styles do.
The query!
macro is a useful wrapper around this
to match the syntax used in styles.
Implementations§
source§impl<'a, E> Query<'a, E>where
E: Extension + 'a,
impl<'a, E> Query<'a, E>where
E: Extension + 'a,
sourcepub fn into_owned(self) -> Query<'static, E>
pub fn into_owned(self) -> Query<'static, E>
Converts an empty query into an owned one
sourcepub fn name<S>(self, name: S) -> Query<'a, E>where
S: Into<Cow<'a, str>>,
pub fn name<S>(self, name: S) -> Query<'a, E>where
S: Into<Cow<'a, str>>,
Matches against the name of the current node if it is an element, fails otherwise.
sourcepub fn property<S, V>(self, key: S, val: V) -> Query<'a, E>where
V: AsValueRef<'a, E> + 'a,
S: Into<Cow<'a, str>>,
pub fn property<S, V>(self, key: S, val: V) -> Query<'a, E>where
V: AsValueRef<'a, E> + 'a,
S: Into<Cow<'a, str>>,
Matches against a property on the current node compares the value. Fails if the property is missing or the value doesn’t match.