pub struct Rule {
pub selectors: Vec<SelectorBuf>,
pub declarations: Vec<Declaration>,
pub origin: Origin,
pub source_order: usize,
pub media: Option<MediaQuery>,
pub selector: LegacySelectorShim,
}Expand description
One CSS rule (one selector_list { decl* } block).
Fields§
§selectors: Vec<SelectorBuf>Compound selector list (each entry is one selector in the comma-separated list).
declarations: Vec<Declaration>property: value pairs in source order, with !important
resolved at parse time.
origin: OriginCascade origin. Defaults to Origin::Author; the runtime tags
the built-in skin sheet as Origin::UserAgent before the
combined cascade pass. The first term of the cascade sort.
source_order: usizeSource ordinal across the stylesheet (the last tiebreaker in the cascade sort).
media: Option<MediaQuery>@media (...) enclosing query, if any.
selector: LegacySelectorShimBack-compat shim that exposes the leftmost compound of the
first selector under the old single-Selector shape - the
Stylesheet::root_vars and StyleInvalidationCache paths
still poke at rule.selector.classes / rule.selector.tag.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
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 Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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.