Struct scraper::selector::Parser

source ·
pub struct Parser;
Expand description

An implementation of Parser for selectors

Trait Implementations§

source§

impl Clone for Parser

source§

fn clone(&self) -> Parser

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parser

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'i> Parser<'i> for Parser

§

type Impl = Simple

§

type Error = SelectorParseErrorKind<'i>

source§

fn parse_slotted(&self) -> bool

Whether to parse the ::slotted() pseudo-element.
source§

fn parse_part(&self) -> bool

Whether to parse the ::part() pseudo-element.
source§

fn parse_nth_child_of(&self) -> bool

Whether to parse the selector list of nth-child() or nth-last-child().
source§

fn parse_is_and_where(&self) -> bool

Whether to parse the :where pseudo-class.
source§

fn parse_has(&self) -> bool

Whether to parse the :has pseudo-class.
source§

fn parse_parent_selector(&self) -> bool

Whether to parse the ‘&’ delimiter as a parent selector.
source§

fn is_is_alias(&self, _name: &str) -> bool

Whether the given function name is an alias for the :is() function.
source§

fn parse_host(&self) -> bool

Whether to parse the :host pseudo-class.
source§

fn allow_forgiving_selectors(&self) -> bool

Whether to allow forgiving selector-list parsing.
source§

fn parse_non_ts_pseudo_class( &self, location: SourceLocation, name: CowRcStr<'i> ) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>>

This function can return an “Err” pseudo-element in order to support CSS2.1 pseudo-elements.
source§

fn parse_non_ts_functional_pseudo_class<'t>( &self, name: CowRcStr<'i>, arguments: &mut Parser<'i, 't> ) -> Result<<Self::Impl as SelectorImpl>::NonTSPseudoClass, ParseError<'i, Self::Error>>

source§

fn parse_pseudo_element( &self, location: SourceLocation, name: CowRcStr<'i> ) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>

source§

fn parse_functional_pseudo_element<'t>( &self, name: CowRcStr<'i>, arguments: &mut Parser<'i, 't> ) -> Result<<Self::Impl as SelectorImpl>::PseudoElement, ParseError<'i, Self::Error>>

source§

fn default_namespace( &self ) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl>

source§

fn namespace_for_prefix( &self, _prefix: &<Self::Impl as SelectorImpl>::NamespacePrefix ) -> Option<<Self::Impl as SelectorImpl>::NamespaceUrl>

source§

impl Copy for Parser

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.