pub struct SelectorList<Impl: SelectorImpl>(ThinArcUnion<SpecificityAndFlags, Component<Impl>, (), Selector<Impl>>);
Expand description

A selector list is a tagged pointer with either a single selector, or a ThinArc<()> of multiple selectors.

Tuple Fields§

§0: ThinArcUnion<SpecificityAndFlags, Component<Impl>, (), Selector<Impl>>

Implementations§

source§

impl<Impl: SelectorImpl> SelectorList<Impl>

source

pub fn from_one(selector: Selector<Impl>) -> Self

source

pub fn from_iter(iter: impl ExactSizeIterator<Item = Selector<Impl>>) -> Self

source

pub fn slice(&self) -> &[Selector<Impl>]

source

pub fn len(&self) -> usize

source

pub fn thin_arc_heap_ptr(&self) -> *const c_void

Returns the address on the heap of the ThinArc for memory reporting.

source§

impl<Impl: SelectorImpl> SelectorList<Impl>

source

pub fn ampersand() -> Self

Returns a selector list with a single &

source

pub fn parse<'i, 't, P>( parser: &P, input: &mut CssParser<'i, 't>, parse_relative: ParseRelative ) -> Result<Self, ParseError<'i, P::Error>>where P: Parser<'i, Impl = Impl>,

Parse a comma-separated list of Selectors. https://drafts.csswg.org/selectors/#grouping

Return the Selectors or Err if there is an invalid selector.

source

fn parse_with_state<'i, 't, P>( parser: &P, input: &mut CssParser<'i, 't>, state: SelectorParsingState, recovery: ForgivingParsing, parse_relative: ParseRelative ) -> Result<Self, ParseError<'i, P::Error>>where P: Parser<'i, Impl = Impl>,

source

pub fn replace_parent_selector(&self, parent: &SelectorList<Impl>) -> Self

Replaces the parent selector in all the items of the selector list.

source

pub(crate) fn from_vec(v: Vec<Selector<Impl>>) -> Self

Creates a SelectorList from a Vec of selectors. Used in tests.

Trait Implementations§

source§

impl<Impl: Clone + SelectorImpl> Clone for SelectorList<Impl>

source§

fn clone(&self) -> SelectorList<Impl>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Impl: Debug + SelectorImpl> Debug for SelectorList<Impl>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Impl: PartialEq + SelectorImpl> PartialEq<SelectorList<Impl>> for SelectorList<Impl>

source§

fn eq(&self, other: &SelectorList<Impl>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Impl: SelectorImpl> ToCss for SelectorList<Impl>

source§

fn to_css<W>(&self, dest: &mut W) -> Resultwhere W: Write,

Serialize self in CSS syntax, writing to dest.
source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
source§

impl<Impl: SelectorImpl> ToShmem for SelectorList<Impl>where ThinArcUnion<SpecificityAndFlags, Component<Impl>, (), Selector<Impl>>: ToShmem,

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

impl<Impl: Eq + SelectorImpl> Eq for SelectorList<Impl>

source§

impl<Impl: SelectorImpl> StructuralEq for SelectorList<Impl>

source§

impl<Impl: SelectorImpl> StructuralPartialEq for SelectorList<Impl>

Auto Trait Implementations§

§

impl<Impl> RefUnwindSafe for SelectorList<Impl>where <Impl as SelectorImpl>::AttrValue: RefUnwindSafe, <Impl as SelectorImpl>::Identifier: RefUnwindSafe, <Impl as SelectorImpl>::LocalName: RefUnwindSafe, <Impl as SelectorImpl>::NamespacePrefix: RefUnwindSafe, <Impl as SelectorImpl>::NamespaceUrl: RefUnwindSafe, <Impl as SelectorImpl>::NonTSPseudoClass: RefUnwindSafe, <Impl as SelectorImpl>::PseudoElement: RefUnwindSafe,

§

impl<Impl> Send for SelectorList<Impl>where <Impl as SelectorImpl>::AttrValue: Send + Sync, <Impl as SelectorImpl>::Identifier: Send + Sync, <Impl as SelectorImpl>::LocalName: Send + Sync, <Impl as SelectorImpl>::NamespacePrefix: Send + Sync, <Impl as SelectorImpl>::NamespaceUrl: Send + Sync, <Impl as SelectorImpl>::NonTSPseudoClass: Send + Sync, <Impl as SelectorImpl>::PseudoElement: Send + Sync,

§

impl<Impl> Sync for SelectorList<Impl>where <Impl as SelectorImpl>::AttrValue: Send + Sync, <Impl as SelectorImpl>::Identifier: Send + Sync, <Impl as SelectorImpl>::LocalName: Send + Sync, <Impl as SelectorImpl>::NamespacePrefix: Send + Sync, <Impl as SelectorImpl>::NamespaceUrl: Send + Sync, <Impl as SelectorImpl>::NonTSPseudoClass: Send + Sync, <Impl as SelectorImpl>::PseudoElement: Send + Sync,

§

impl<Impl> Unpin for SelectorList<Impl>where <Impl as SelectorImpl>::AttrValue: Unpin, <Impl as SelectorImpl>::Identifier: Unpin, <Impl as SelectorImpl>::LocalName: Unpin, <Impl as SelectorImpl>::NamespacePrefix: Unpin, <Impl as SelectorImpl>::NamespaceUrl: Unpin, <Impl as SelectorImpl>::NonTSPseudoClass: Unpin, <Impl as SelectorImpl>::PseudoElement: Unpin,

§

impl<Impl> UnwindSafe for SelectorList<Impl>where <Impl as SelectorImpl>::AttrValue: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::Identifier: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::LocalName: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::NamespacePrefix: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::NamespaceUrl: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::NonTSPseudoClass: UnwindSafe + RefUnwindSafe, <Impl as SelectorImpl>::PseudoElement: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.