pub struct SelectorPath { /* private fields */ }Implementations§
Source§impl SelectorPath
impl SelectorPath
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Returns true if this is a bare wildcard (*) with no predicates.
pub fn parse(input: &str) -> Result<Self, AutomataError>
Sourcepub fn find_one<E: Element>(&self, root: &E) -> Option<E>
pub fn find_one<E: Element>(&self, root: &E) -> Option<E>
Find the first element matching this path, starting from root.
Uses an early-exit strategy: descendant searches stop as soon as the first match is found, avoiding a full DFS of the entire subtree.
Sourcepub fn find_all<E: Element>(&self, root: &E) -> Vec<E>
pub fn find_all<E: Element>(&self, root: &E) -> Vec<E>
Find all elements matching this path, starting from root.
Sourcepub fn matches<E: Element>(&self, element: &E) -> bool
pub fn matches<E: Element>(&self, element: &E) -> bool
Test whether a single element matches the first step of this path (useful for single-step selectors used as element filters).
Sourcepub fn find_one_with_parent<E: Element>(
&self,
root: &E,
) -> Option<(E, Option<E>)>
pub fn find_one_with_parent<E: Element>( &self, root: &E, ) -> Option<(E, Option<E>)>
Like [find_one], but also returns the “step parent” — the element from
which the final selector step was resolved.
The step parent is stored in the found-cache alongside the element so
that when the element goes stale, a narrow re-search can be attempted
from the step parent before falling back to a full DFS from the anchor
root. The step parent is None for root-step selectors that match the
root element itself.
Sourcepub fn matches_tab_info(&self, title: &str, url: &str) -> bool
pub fn matches_tab_info(&self, title: &str, url: &str) -> bool
Test whether a TabInfo matches the predicates in the first step of this selector.
Used for Tab anchor attach mode — polls Browser::tabs() until a matching tab
appears. Recognized attributes: title / name → tab title, url → tab URL.
Other attributes (role, id) always pass, treating them as “don’t care”.
Sourcepub fn find_one_from_step_parent<E: Element>(
&self,
step_parent: &E,
) -> Option<E>
pub fn find_one_from_step_parent<E: Element>( &self, step_parent: &E, ) -> Option<E>
Re-find using only the last step of this selector, starting from a cached step-parent.
This is the fast-path for stale-element re-resolution: instead of a full DFS from the anchor root, we search only within the step-parent’s immediate children or subtree (depending on the final combinator).
Returns None if the element is no longer present under step_parent.
Trait Implementations§
Source§impl Clone for SelectorPath
impl Clone for SelectorPath
Source§fn clone(&self) -> SelectorPath
fn clone(&self) -> SelectorPath
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectorPath
impl Debug for SelectorPath
Source§impl<'de> Deserialize<'de> for SelectorPath
impl<'de> Deserialize<'de> for SelectorPath
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for SelectorPath
impl Display for SelectorPath
Source§impl JsonSchema for SelectorPath
impl JsonSchema for SelectorPath
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§fn json_schema(_sg: &mut SchemaGenerator) -> Schema
fn json_schema(_sg: &mut SchemaGenerator) -> Schema
Source§impl PartialEq for SelectorPath
impl PartialEq for SelectorPath
impl Eq for SelectorPath
impl StructuralPartialEq for SelectorPath
Auto Trait Implementations§
impl Freeze for SelectorPath
impl RefUnwindSafe for SelectorPath
impl Send for SelectorPath
impl Sync for SelectorPath
impl Unpin for SelectorPath
impl UnsafeUnpin for SelectorPath
impl UnwindSafe for SelectorPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.