Skip to main content

SelectorImpl

Trait 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;
    type PseudoElement: Clone + Eq + PseudoElement;

    // 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

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

Source

type PseudoElement: Clone + Eq + PseudoElement

pseudo-elements

Provided Methods§

Source

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

Whether attribute hashes should be collected for filtering purposes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§