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;
type LocalName: Clone + Eq + for<'a> From<&'a str> + ToCss + Borrow<Self::BorrowedLocalName>;
type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl>;
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
type LocalName: Clone + Eq + for<'a> From<&'a str> + ToCss + Borrow<Self::BorrowedLocalName>
type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.