pub trait Queryable {
// Required methods
fn find(&self) -> FindBuilder<'_>;
fn find_all(&self) -> FindAllBuilder<'_>;
}Expand description
Types that expose find() + find_all() queries scoped to themselves.
Implemented by crate::Tab (queries scoped to main frame),
crate::Frame (queries scoped to that frame’s contextId), and
crate::Element (queries scoped to the element’s subtree). Use this
trait when writing helpers that should work against any of the three.
§Examples
use zendriver::Queryable;
async fn first_link<Q: Queryable + Sync>(q: &Q) -> zendriver::Result<zendriver::Element> {
q.find().css("a").one().await
}Required Methods§
Sourcefn find(&self) -> FindBuilder<'_>
fn find(&self) -> FindBuilder<'_>
Start a single-element query. See crate::Tab::find for the
terminal + modifier surface.
Sourcefn find_all(&self) -> FindAllBuilder<'_>
fn find_all(&self) -> FindAllBuilder<'_>
Start a multi-element query. See crate::Tab::find_all for the
terminal + modifier surface.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".