Trait selectors::parser::SelectorImpl

source ·
pub trait SelectorImpl: Clone + Debug + Sized + 'static {
    type ExtraMatchingData<'a>: Sized + Default;
    type AttrValue: Clone + Eq + for<'a> From<&'a str> + ToCss;
    type Identifier: Clone + Eq + for<'a> From<&'a str> + ToCss + PrecomputedHash;
    type LocalName: Clone + Eq + for<'a> From<&'a str> + ToCss + Borrow<Self::BorrowedLocalName> + PrecomputedHash;
    type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl> + PrecomputedHash;
    type NamespacePrefix: Clone + Eq + for<'a> From<&'a str> + ToCss + Default;
    type BorrowedNamespaceUrl: ?Sized + Eq;
    type BorrowedLocalName: ?Sized + Eq;
    type NonTSPseudoClass: Clone + Eq + NonTSPseudoClass<Impl = Self>;
    type PseudoElement: Clone + Eq + PseudoElement<Impl = Self>;

    // Provided method
    fn should_collect_attr_hash(_name: &Self::LocalName) -> bool { ... }
}
Expand description

This trait allows to define the parser implementation in regards of pseudo-classes/elements

NB: We need Clone so that we can derive(Clone) on struct with that are parameterized on SelectorImpl. See https://github.com/rust-lang/rust/issues/26925

Required Associated Types§

source

type ExtraMatchingData<'a>: Sized + Default

source

type AttrValue: Clone + Eq + for<'a> From<&'a str> + ToCss

source

type Identifier: Clone + Eq + for<'a> From<&'a str> + ToCss + PrecomputedHash

source

type LocalName: Clone + Eq + for<'a> From<&'a str> + ToCss + Borrow<Self::BorrowedLocalName> + PrecomputedHash

source

type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl> + PrecomputedHash

source

type NamespacePrefix: Clone + Eq + for<'a> From<&'a str> + ToCss + Default

source

type BorrowedNamespaceUrl: ?Sized + Eq

source

type BorrowedLocalName: ?Sized + Eq

source

type NonTSPseudoClass: Clone + Eq + NonTSPseudoClass<Impl = Self>

non tree-structural pseudo-classes (see: https://drafts.csswg.org/selectors/#structural-pseudos)

source

type PseudoElement: Clone + Eq + PseudoElement<Impl = Self>

pseudo-elements

Provided Methods§

source

fn should_collect_attr_hash(_name: &Self::LocalName) -> bool

Whether attribute hashes should be collected for filtering purposes.

Object Safety§

This trait is not object safe.

Implementors§