pub struct SelectorBuf {
pub chain: Vec<(Combinator, CompoundSelector)>,
}Expand description
Compiled selector: a chain of compound selectors joined by combinators.
The chain is stored left-to-right in CSS source order - so
.outer .inner > .x becomes:
[(Subject, .outer), (Descendant, .inner), (Child, .x)]
The subject of the selector (the element that the rule applies
to) is the last compound in the chain. The first entry’s
combinator is always Combinator::Subject and records that
there is nothing to its left.
Fields§
§chain: Vec<(Combinator, CompoundSelector)>Compound chain in CSS source order (subject is the last entry).
Implementations§
Source§impl SelectorBuf
impl SelectorBuf
Sourcepub fn specificity(&self) -> Specificity
pub fn specificity(&self) -> Specificity
Specificity per Selectors-4 section 17 - (a, b, c) where
a = #ids, b = #classes + #pseudo-classes + #attr selectors,
c = #tags + #pseudo-elements.
Trait Implementations§
Source§impl Clone for SelectorBuf
impl Clone for SelectorBuf
Source§fn clone(&self) -> SelectorBuf
fn clone(&self) -> SelectorBuf
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectorBuf
impl Debug for SelectorBuf
Source§impl<'de> Deserialize<'de> for SelectorBuf
impl<'de> Deserialize<'de> for SelectorBuf
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SelectorBuf
impl RefUnwindSafe for SelectorBuf
impl Send for SelectorBuf
impl Sync for SelectorBuf
impl Unpin for SelectorBuf
impl UnsafeUnpin for SelectorBuf
impl UnwindSafe for SelectorBuf
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.