pub struct Query { /* private fields */ }Expand description
Provides fluent API interfaces and result caching to simplify queries and operations.
Implementations§
Source§impl Query
impl Query
pub fn new(html: &str) -> Self
Sourcepub fn from(self, context: SelectionResult, selector: &str) -> Self
pub fn from(self, context: SelectionResult, selector: &str) -> Self
Query nodes from the specified context.
Sourcepub fn node(self) -> Option<NodeHandle>
pub fn node(self) -> Option<NodeHandle>
Get the result of the first node.
Sourcepub fn nodes(self) -> Vec<NodeHandle>
pub fn nodes(self) -> Vec<NodeHandle>
Get results of all nodes
Sourcepub fn result(self) -> InterpreterResult<SelectionResult>
pub fn result(self) -> InterpreterResult<SelectionResult>
Obtain the final query results.
Sourcepub fn then(self, selector: &str) -> Self
pub fn then(self, selector: &str) -> Self
Use the query results as the context for another query.
Sourcepub fn clear_cache(self) -> Self
pub fn clear_cache(self) -> Self
Clear cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl !RefUnwindSafe for Query
impl !Send for Query
impl !Sync for Query
impl Unpin for Query
impl !UnwindSafe for Query
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more