Enum style::stylesheets::CssRule
source · pub enum CssRule {
Show 16 variants
Namespace(Arc<Locked<NamespaceRule>>),
Import(Arc<Locked<ImportRule>>),
Style(Arc<Locked<StyleRule>>),
Media(Arc<Locked<MediaRule>>),
Container(Arc<Locked<ContainerRule>>),
FontFace(Arc<Locked<FontFaceRule>>),
FontFeatureValues(Arc<Locked<FontFeatureValuesRule>>),
CounterStyle(Arc<Locked<CounterStyleRule>>),
Viewport(Arc<Locked<ViewportRule>>),
Keyframes(Arc<Locked<KeyframesRule>>),
Supports(Arc<Locked<SupportsRule>>),
Page(Arc<Locked<PageRule>>),
Document(Arc<Locked<DocumentRule>>),
LayerBlock(Arc<Locked<LayerBlockRule>>),
LayerStatement(Arc<Locked<LayerStatementRule>>),
ScrollTimeline(Arc<Locked<ScrollTimelineRule>>),
}
Expand description
A CSS rule.
TODO(emilio): Lots of spec links should be around.
Variants§
Namespace(Arc<Locked<NamespaceRule>>)
Import(Arc<Locked<ImportRule>>)
Style(Arc<Locked<StyleRule>>)
Media(Arc<Locked<MediaRule>>)
Container(Arc<Locked<ContainerRule>>)
FontFace(Arc<Locked<FontFaceRule>>)
FontFeatureValues(Arc<Locked<FontFeatureValuesRule>>)
CounterStyle(Arc<Locked<CounterStyleRule>>)
Viewport(Arc<Locked<ViewportRule>>)
Keyframes(Arc<Locked<KeyframesRule>>)
Supports(Arc<Locked<SupportsRule>>)
Page(Arc<Locked<PageRule>>)
Document(Arc<Locked<DocumentRule>>)
LayerBlock(Arc<Locked<LayerBlockRule>>)
LayerStatement(Arc<Locked<LayerStatementRule>>)
ScrollTimeline(Arc<Locked<ScrollTimelineRule>>)
Implementations§
source§impl CssRule
impl CssRule
sourcepub fn rule_type(&self) -> CssRuleType
pub fn rule_type(&self) -> CssRuleType
Returns the CSSOM rule type of this rule.
sourcepub fn parse(
css: &str,
insert_rule_context: InsertRuleContext<'_>,
parent_stylesheet_contents: &StylesheetContents,
shared_lock: &SharedRwLock,
state: State,
loader: Option<&dyn StylesheetLoader>,
allow_import_rules: AllowImportRules
) -> Result<Self, RulesMutateError>
pub fn parse(
css: &str,
insert_rule_context: InsertRuleContext<'_>,
parent_stylesheet_contents: &StylesheetContents,
shared_lock: &SharedRwLock,
state: State,
loader: Option<&dyn StylesheetLoader>,
allow_import_rules: AllowImportRules
) -> Result<Self, RulesMutateError>
Parse a CSS rule.
Returns a parsed CSS rule and the final state of the parser.
Input state is None for a nested rule
Trait Implementations§
source§impl DeepCloneWithLock for CssRule
impl DeepCloneWithLock for CssRule
source§fn deep_clone_with_lock(
&self,
lock: &SharedRwLock,
guard: &SharedRwLockReadGuard<'_>,
params: &DeepCloneParams
) -> CssRule
fn deep_clone_with_lock(
&self,
lock: &SharedRwLock,
guard: &SharedRwLockReadGuard<'_>,
params: &DeepCloneParams
) -> CssRule
Deep clones this CssRule.
source§impl ToCssWithGuard for CssRule
impl ToCssWithGuard for CssRule
source§fn to_css(
&self,
guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
fn to_css(
&self,
guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
Serialize
self
in CSS syntax, writing to dest
, using the given lock guard.source§fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
Serialize
self
in CSS syntax using the given lock guard and return a string. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CssRule
impl Send for CssRule
impl Sync for CssRule
impl Unpin for CssRule
impl !UnwindSafe for CssRule
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert