Trait Query

Source
pub trait Query {
    // Required methods
    fn get<M: Matcher>(&self, rules: &M) -> Option<HtmlElement>;
    fn get_all<M: Matcher>(&self, rules: &M) -> Vec<HtmlElement>;
}
Expand description

Allows selecting HtmlElements using Matchers.

By default implemented for Element where it selects it’s children matching provided pattern.

Required Methods§

Source

fn get<M: Matcher>(&self, rules: &M) -> Option<HtmlElement>

Tries to get a unique component. Returns None on failure and HtmlElement on success.

§Panics:

If more than one element is found.

Source

fn get_all<M: Matcher>(&self, rules: &M) -> Vec<HtmlElement>

Returns a Vec of all components matched by a Matcher.

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.

Implementations on Foreign Types§

Source§

impl Query for Element

Source§

fn get<M: Matcher>(&self, matcher: &M) -> Option<HtmlElement>

Source§

fn get_all<M: Matcher>(&self, matcher: &M) -> Vec<HtmlElement>

Implementors§