Trait parcel_selectors::parser::SelectorImpl
source · pub trait SelectorImpl<'i>: Clone + Debug + Sized + 'static {
type ExtraMatchingData: Sized + Default + 'static;
type AttrValue: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss;
type Identifier: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss;
type LocalName: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss + Borrow<Self::BorrowedLocalName>;
type NamespaceUrl: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + Default + Borrow<Self::BorrowedNamespaceUrl>;
type NamespacePrefix: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss + Default;
type BorrowedNamespaceUrl: ?Sized + Eq;
type BorrowedLocalName: ?Sized + Eq;
type NonTSPseudoClass: Clone + PartialEq + Eq + Hash + NonTSPseudoClass<'i, Impl = Self>;
type VendorPrefix: Sized + Eq + Clone + PartialEq + Hash + ToCss;
type PseudoElement: Clone + PartialEq + Eq + Hash + PseudoElement<'i, Impl = Self>;
// Provided method
fn to_css<W: Write>(
selectors: &SelectorList<'i, Self>,
dest: &mut W
) -> Result { ... }
}
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: Sized + Default + 'static
type AttrValue: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss
type Identifier: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss
type LocalName: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss + Borrow<Self::BorrowedLocalName>
type NamespaceUrl: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + Default + Borrow<Self::BorrowedNamespaceUrl>
type NamespacePrefix: Clone + PartialEq + Eq + Hash + From<CowRcStr<'i>> + ToCss + Default
type BorrowedNamespaceUrl: ?Sized + Eq
type BorrowedLocalName: ?Sized + Eq
sourcetype NonTSPseudoClass: Clone + PartialEq + Eq + Hash + NonTSPseudoClass<'i, Impl = Self>
type NonTSPseudoClass: Clone + PartialEq + Eq + Hash + NonTSPseudoClass<'i, Impl = Self>
non tree-structural pseudo-classes (see: https://drafts.csswg.org/selectors/#structural-pseudos)
type VendorPrefix: Sized + Eq + Clone + PartialEq + Hash + ToCss
sourcetype PseudoElement: Clone + PartialEq + Eq + Hash + PseudoElement<'i, Impl = Self>
type PseudoElement: Clone + PartialEq + Eq + Hash + PseudoElement<'i, Impl = Self>
pseudo-elements