Struct selectors::parser::SelectorList
source · 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>
impl<Impl: SelectorImpl> SelectorList<Impl>
sourcepub fn mark_as_intentionally_leaked(&self)
pub fn mark_as_intentionally_leaked(&self)
See Arc::mark_as_intentionally_leaked
pub fn from_one(selector: Selector<Impl>) -> Self
pub fn from_iter(iter: impl ExactSizeIterator<Item = Selector<Impl>>) -> Self
pub fn slice(&self) -> &[Selector<Impl>]
pub fn len(&self) -> usize
sourcepub fn thin_arc_heap_ptr(&self) -> *const c_void
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>
impl<Impl: SelectorImpl> SelectorList<Impl>
sourcepub fn scope() -> Self
pub fn scope() -> Self
Returns a selector list with a single :scope
selector (with specificity)
sourcepub fn implicit_scope() -> Self
pub fn implicit_scope() -> Self
Returns a selector list with a single implicit :scope
selector (no specificity)
sourcepub 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>,
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.
sourcepub fn parse_disallow_pseudo<'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>,
pub fn parse_disallow_pseudo<'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>,
Same as parse
, but disallow parsing of pseudo-elements.
pub fn parse_forgiving<'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>,
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>,
sourcepub fn replace_parent_selector(&self, parent: &SelectorList<Impl>) -> Self
pub fn replace_parent_selector(&self, parent: &SelectorList<Impl>) -> Self
Replaces the parent selector in all the items of the selector list.
Trait Implementations§
source§impl<Impl: Clone + SelectorImpl> Clone for SelectorList<Impl>
impl<Impl: Clone + SelectorImpl> Clone for SelectorList<Impl>
source§fn clone(&self) -> SelectorList<Impl>
fn clone(&self) -> SelectorList<Impl>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Impl: Debug + SelectorImpl> Debug for SelectorList<Impl>
impl<Impl: Debug + SelectorImpl> Debug for SelectorList<Impl>
source§impl<Impl: PartialEq + SelectorImpl> PartialEq for SelectorList<Impl>
impl<Impl: PartialEq + SelectorImpl> PartialEq for SelectorList<Impl>
source§impl<Impl: SelectorImpl> ToCss for SelectorList<Impl>
impl<Impl: SelectorImpl> ToCss for SelectorList<Impl>
source§impl<Impl: SelectorImpl> ToShmem for SelectorList<Impl>
impl<Impl: SelectorImpl> ToShmem for SelectorList<Impl>
impl<Impl: Eq + SelectorImpl> Eq for SelectorList<Impl>
impl<Impl: SelectorImpl> StructuralPartialEq for SelectorList<Impl>
Auto Trait Implementations§
impl<Impl> Freeze for SelectorList<Impl>
impl<Impl> RefUnwindSafe for SelectorList<Impl>where
<Impl as SelectorImpl>::Identifier: RefUnwindSafe,
<Impl as SelectorImpl>::LocalName: RefUnwindSafe,
<Impl as SelectorImpl>::AttrValue: RefUnwindSafe,
<Impl as SelectorImpl>::NamespaceUrl: RefUnwindSafe,
<Impl as SelectorImpl>::NamespacePrefix: RefUnwindSafe,
<Impl as SelectorImpl>::NonTSPseudoClass: RefUnwindSafe,
<Impl as SelectorImpl>::PseudoElement: RefUnwindSafe,
impl<Impl> Send for SelectorList<Impl>where
<Impl as SelectorImpl>::Identifier: Sync + Send,
<Impl as SelectorImpl>::LocalName: Sync + Send,
<Impl as SelectorImpl>::AttrValue: Sync + Send,
<Impl as SelectorImpl>::NamespaceUrl: Sync + Send,
<Impl as SelectorImpl>::NamespacePrefix: Sync + Send,
<Impl as SelectorImpl>::NonTSPseudoClass: Sync + Send,
<Impl as SelectorImpl>::PseudoElement: Sync + Send,
impl<Impl> Sync for SelectorList<Impl>where
<Impl as SelectorImpl>::Identifier: Sync + Send,
<Impl as SelectorImpl>::LocalName: Sync + Send,
<Impl as SelectorImpl>::AttrValue: Sync + Send,
<Impl as SelectorImpl>::NamespaceUrl: Sync + Send,
<Impl as SelectorImpl>::NamespacePrefix: Sync + Send,
<Impl as SelectorImpl>::NonTSPseudoClass: Sync + Send,
<Impl as SelectorImpl>::PseudoElement: Sync + Send,
impl<Impl> Unpin for SelectorList<Impl>where
<Impl as SelectorImpl>::Identifier: Unpin,
<Impl as SelectorImpl>::LocalName: Unpin,
<Impl as SelectorImpl>::AttrValue: Unpin,
<Impl as SelectorImpl>::NamespaceUrl: Unpin,
<Impl as SelectorImpl>::NamespacePrefix: Unpin,
<Impl as SelectorImpl>::NonTSPseudoClass: Unpin,
<Impl as SelectorImpl>::PseudoElement: Unpin,
impl<Impl> UnwindSafe for SelectorList<Impl>where
<Impl as SelectorImpl>::Identifier: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::LocalName: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::AttrValue: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::NamespaceUrl: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::NamespacePrefix: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::NonTSPseudoClass: UnwindSafe + RefUnwindSafe,
<Impl as SelectorImpl>::PseudoElement: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)