pub struct Selector { /* private fields */ }Expand description
A parsed selector. Construct with Selector::parse.
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn parse(input: &str) -> Result<Selector, ParseSelectorError>
pub fn parse(input: &str) -> Result<Selector, ParseSelectorError>
Parse a selector string. See the module docs for the supported subset.
Sourcepub fn matches(&self, popped: &Node<'_>, stack: &[&Node<'_>]) -> bool
pub fn matches(&self, popped: &Node<'_>, stack: &[&Node<'_>]) -> bool
Match this selector against the just-closed arena node popped,
given its ancestor chain stack (root at index 0).
stack is the ancestor chain by reference: stack[0] is the root,
stack[stack.len() - 1] is the immediate parent of popped. All
references typically come from one sup_xml_tree::dom::Document
but the matcher doesn’t enforce this — it only reads name and
attributes().
Trait Implementations§
impl Eq for Selector
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
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