Enum lightningcss::rules::CssRule
source · pub enum CssRule<'i, R = DefaultAtRule> {
Show 21 variants
Media(MediaRule<'i, R>),
Import(ImportRule<'i>),
Style(StyleRule<'i, R>),
Keyframes(KeyframesRule<'i>),
FontFace(FontFaceRule<'i>),
FontPaletteValues(FontPaletteValuesRule<'i>),
Page(PageRule<'i>),
Supports(SupportsRule<'i, R>),
CounterStyle(CounterStyleRule<'i>),
Namespace(NamespaceRule<'i>),
MozDocument(MozDocumentRule<'i, R>),
Nesting(NestingRule<'i, R>),
Viewport(ViewportRule<'i>),
CustomMedia(CustomMediaRule<'i>),
LayerStatement(LayerStatementRule<'i>),
LayerBlock(LayerBlockRule<'i, R>),
Property(PropertyRule<'i>),
Container(ContainerRule<'i, R>),
Ignored,
Unknown(UnknownAtRule<'i>),
Custom(R),
}
Expand description
A CSS rule.
Variants§
Media(MediaRule<'i, R>)
A @media
rule.
Import(ImportRule<'i>)
An @import
rule.
Style(StyleRule<'i, R>)
A style rule.
Keyframes(KeyframesRule<'i>)
A @keyframes
rule.
FontFace(FontFaceRule<'i>)
A @font-face
rule.
FontPaletteValues(FontPaletteValuesRule<'i>)
A @font-palette-values
rule.
Page(PageRule<'i>)
A @page
rule.
Supports(SupportsRule<'i, R>)
A @supports
rule.
CounterStyle(CounterStyleRule<'i>)
A @counter-style
rule.
Namespace(NamespaceRule<'i>)
A @namespace
rule.
MozDocument(MozDocumentRule<'i, R>)
A @-moz-document
rule.
Nesting(NestingRule<'i, R>)
A @nest
rule.
Viewport(ViewportRule<'i>)
A @viewport
rule.
CustomMedia(CustomMediaRule<'i>)
A @custom-media
rule.
LayerStatement(LayerStatementRule<'i>)
A @layer
statement rule.
LayerBlock(LayerBlockRule<'i, R>)
A @layer
block rule.
Property(PropertyRule<'i>)
A @property
rule.
Container(ContainerRule<'i, R>)
A @container
rule.
Ignored
A placeholder for a rule that was removed.
Unknown(UnknownAtRule<'i>)
An unknown at-rule.
Custom(R)
A custom at-rule.
Implementations§
source§impl<'i, T> CssRule<'i, T>
impl<'i, T> CssRule<'i, T>
sourcepub fn parse<'t, P: AtRuleParser<'i, AtRule = T>>(
input: &mut Parser<'i, 't>,
options: &mut ParserOptions<'_, 'i, P>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
pub fn parse<'t, P: AtRuleParser<'i, AtRule = T>>(
input: &mut Parser<'i, 't>,
options: &mut ParserOptions<'_, 'i, P>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a single rule.
sourcepub fn parse_string<P: AtRuleParser<'i, AtRule = T>>(
input: &'i str,
options: ParserOptions<'_, 'i, P>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
pub fn parse_string<P: AtRuleParser<'i, AtRule = T>>(
input: &'i str,
options: ParserOptions<'_, 'i, P>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a single rule from a string.
Trait Implementations§
source§impl<'i, R: PartialEq> PartialEq<CssRule<'i, R>> for CssRule<'i, R>
impl<'i, R: PartialEq> PartialEq<CssRule<'i, R>> for CssRule<'i, R>
source§impl<'i, T: ToCss> ToCss for CssRule<'i, T>
impl<'i, T: ToCss> ToCss for CssRule<'i, T>
source§fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError>where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError>where
W: Write,
Serialize
self
in CSS syntax, writing to dest
.source§fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
Serialize
self
in CSS syntax and return a string. Read moresource§impl<'i, R, __V: Visitor<'i, R>> Visit<'i, R, __V> for CssRule<'i, R>where
R: Visit<'i, R, __V>,
impl<'i, R, __V: Visitor<'i, R>> Visit<'i, R, __V> for CssRule<'i, R>where
R: Visit<'i, R, __V>,
source§const CHILD_TYPES: VisitTypes = _
const CHILD_TYPES: VisitTypes = _
The types of values contained within this value and its children.
This is used to skip branches that don’t have any values requested
by the Visitor. Read more
source§fn visit(&mut self, visitor: &mut __V)
fn visit(&mut self, visitor: &mut __V)
Visits the value by calling an appropriate method on the Visitor.
If no corresponding visitor method exists, then the children are visited. Read more
source§fn visit_children(&mut self, visitor: &mut __V)
fn visit_children(&mut self, visitor: &mut __V)
Visit the children of this value.
impl<'i, R> StructuralPartialEq for CssRule<'i, R>
Auto Trait Implementations§
impl<'i, R> RefUnwindSafe for CssRule<'i, R>where
R: RefUnwindSafe,
impl<'i, R> Send for CssRule<'i, R>where
R: Send,
impl<'i, R> Sync for CssRule<'i, R>where
R: Sync,
impl<'i, R> Unpin for CssRule<'i, R>where
R: Unpin,
impl<'i, R> UnwindSafe for CssRule<'i, R>where
R: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer