Trait selectors::parser::SelectorImpl
[−]
[src]
pub trait SelectorImpl: Clone + Sized + 'static { type AttrValue: Clone + Eq + for<'a> From<&'a str> + Display; type Identifier: Clone + Eq + for<'a> From<&'a str> + Display + PrecomputedHash; type ClassName: Clone + Eq + for<'a> From<&'a str> + Display + PrecomputedHash; type LocalName: Clone + Eq + for<'a> From<&'a str> + Display + Borrow<Self::BorrowedLocalName> + PrecomputedHash; type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl> + PrecomputedHash; type NamespacePrefix: Clone + Eq + for<'a> From<&'a str> + Display + Default; type BorrowedNamespaceUrl: ?Sized + Eq; type BorrowedLocalName: ?Sized + Eq; type NonTSPseudoClass: Clone + Eq + Sized + ToCss + SelectorMethods<Impl = Self>; type PseudoElement: Clone + Eq + PseudoElement<Impl = Self>; fn is_active_or_hover(pseudo_class: &Self::NonTSPseudoClass) -> bool; }
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
Associated Types
type AttrValue: Clone + Eq + for<'a> From<&'a str> + Display
type Identifier: Clone + Eq + for<'a> From<&'a str> + Display + PrecomputedHash
type ClassName: Clone + Eq + for<'a> From<&'a str> + Display + PrecomputedHash
type LocalName: Clone + Eq + for<'a> From<&'a str> + Display + Borrow<Self::BorrowedLocalName> + PrecomputedHash
type NamespaceUrl: Clone + Eq + Default + Borrow<Self::BorrowedNamespaceUrl> + PrecomputedHash
type NamespacePrefix: Clone + Eq + for<'a> From<&'a str> + Display + Default
type BorrowedNamespaceUrl: ?Sized + Eq
type BorrowedLocalName: ?Sized + Eq
type NonTSPseudoClass: Clone + Eq + Sized + ToCss + SelectorMethods<Impl = Self>
non tree-structural pseudo-classes (see: https://drafts.csswg.org/selectors/#structural-pseudos)
type PseudoElement: Clone + Eq + PseudoElement<Impl = Self>
pseudo-elements
Required Methods
fn is_active_or_hover(pseudo_class: &Self::NonTSPseudoClass) -> bool
Returns whether the given pseudo class is :active or :hover.