Struct Query

Source
pub struct Query<'x, N, F> { /* private fields */ }
Expand description

A query for elements in Soup matching the Filter F

Trait Implementations§

Source§

impl<N, F> Clone for Query<'_, N, F>
where F: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'x, N: Debug, F: Debug> Debug for Query<'x, N, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'x, N, F> IntoIterator for Query<'x, N, F>
where N: Node, F: Filter<N>,

Source§

type Item = QueryItem<'x, N>

The type of the elements being iterated over.
Source§

type IntoIter = QueryIter<'x, N, F>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'x, N, F> Queryable<'x> for Query<'x, N, F>
where N: Node, F: Filter<N>,

Source§

type Node = N

Query node type
Source§

type Filter = F

Already applied filter
Source§

fn recursive(self) -> Query<'x, N, F>

Allows the query to search the entire node tree
Source§

fn strict(self) -> Query<'x, N, F>

Forces the query to only match direct children of the root node
Source§

fn tag<T>(self, tag: T) -> Query<'x, N, And<F, Tag<T>>>
where T: Pattern<N::Text>, Tag<T>: Filter<N>,

Specifies a tag for which to search Read more
Source§

fn attr<Q, V>(self, name: Q, value: V) -> Query<'x, N, And<F, Attr<Q, V>>>
where Q: Pattern<N::Text>, V: Pattern<N::Text>, Attr<Q, V>: Filter<N>,

Specifies an attribute name/value pair for which to search Read more
Source§

fn attr_name<Q>( self, name: Q, ) -> Query<'x, Self::Node, And<Self::Filter, Attr<Q, bool>>>
where Q: Pattern<<Self::Node as Node>::Text>, Attr<Q, bool>: Filter<Self::Node>,

Searches for a tag that has an attribute with the specified name Read more
Source§

fn attr_value<V>( self, value: V, ) -> Query<'x, Self::Node, And<Self::Filter, Attr<bool, V>>>
where V: Pattern<<Self::Node as Node>::Text>, Attr<bool, V>: Filter<Self::Node>,

Search for a node with any attribute with a value that matches the specified value Read more
Source§

fn class<C>( self, class: C, ) -> Query<'x, Self::Node, And<Self::Filter, Attr<&'static str, C>>>
where C: Pattern<<Self::Node as Node>::Text>, <Self::Node as Node>::Text: AsRef<str> + From<&'static str>, Attr<&'static str, C>: Filter<Self::Node>,

Specifies a class name for which to search Read more
Source§

fn first(self) -> Option<Self::Item>
where Self: IntoIterator,

Executes the query, and returns either the first result, or None Read more
Source§

fn all(self) -> Self::IntoIter
where Self: IntoIterator,

Executes the query, and returns an iterator of the results Read more
Source§

impl<N, F> Copy for Query<'_, N, F>
where F: Copy,

Auto Trait Implementations§

§

impl<'x, N, F> Freeze for Query<'x, N, F>
where F: Freeze,

§

impl<'x, N, F> RefUnwindSafe for Query<'x, N, F>

§

impl<'x, N, F> Send for Query<'x, N, F>
where F: Send, N: Sync,

§

impl<'x, N, F> Sync for Query<'x, N, F>
where F: Sync, N: Sync,

§

impl<'x, N, F> Unpin for Query<'x, N, F>
where F: Unpin,

§

impl<'x, N, F> UnwindSafe for Query<'x, N, F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.