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§
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
sourcetype NonTSPseudoClass: Clone + Eq + NonTSPseudoClass<Impl = Self>
type NonTSPseudoClass: Clone + Eq + NonTSPseudoClass<Impl = Self>
non tree-structural pseudo-classes (see: https://drafts.csswg.org/selectors/#structural-pseudos)
sourcetype PseudoElement: Clone + Eq + PseudoElement<Impl = Self>
type PseudoElement: Clone + Eq + PseudoElement<Impl = Self>
pseudo-elements
Provided Methods§
sourcefn should_collect_attr_hash(_name: &Self::LocalName) -> bool
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.