pub enum Rule<'a> {
Show 23 variants
Charset(CharsetRule),
ColorProfile(ColorProfileRule),
Container(ContainerRule<'a>),
CounterStyle(CounterStyleRule),
FontFace(FontFaceRule<'a>),
FontFeatureValues(FontFeatureValuesRule),
FontPaletteValues(FontPaletteValuesRule),
Import(ImportRule),
Keyframes(KeyframesRule<'a>),
Layer(LayerRule<'a>),
Media(MediaRule<'a>),
Namespace(NamespaceRule),
Page(PageRule<'a>),
Property(PropertyRule<'a>),
Scope(ScopeRule),
StartingStyle(StartingStyleRule),
Supports(SupportsRule<'a>),
Document(DocumentRule<'a>),
WebkitKeyframes(WebkitKeyframesRule<'a>),
MozDocument(MozDocumentRule<'a>),
UnknownAt(UnknownAtRule<'a>),
Style(StyleRule<'a>),
Unknown(UnknownQualifiedRule<'a>),
}Variants§
Charset(CharsetRule)
ColorProfile(ColorProfileRule)
Container(ContainerRule<'a>)
CounterStyle(CounterStyleRule)
FontFace(FontFaceRule<'a>)
FontFeatureValues(FontFeatureValuesRule)
FontPaletteValues(FontPaletteValuesRule)
Import(ImportRule)
Keyframes(KeyframesRule<'a>)
Layer(LayerRule<'a>)
Media(MediaRule<'a>)
Namespace(NamespaceRule)
Page(PageRule<'a>)
Property(PropertyRule<'a>)
Scope(ScopeRule)
StartingStyle(StartingStyleRule)
Supports(SupportsRule<'a>)
Document(DocumentRule<'a>)
WebkitKeyframes(WebkitKeyframesRule<'a>)
MozDocument(MozDocumentRule<'a>)
UnknownAt(UnknownAtRule<'a>)
Style(StyleRule<'a>)
Unknown(UnknownQualifiedRule<'a>)
Trait Implementations§
Source§impl<'a> Ord for Rule<'a>
impl<'a> Ord for Rule<'a>
Source§impl<'a> PartialOrd for Rule<'a>
impl<'a> PartialOrd for Rule<'a>
Source§impl<'a> RuleVariants<'a> for Rule<'a>
impl<'a> RuleVariants<'a> for Rule<'a>
Source§fn parse_at_rule<I>(p: &mut Parser<'a, I>, c: Cursor) -> ParserResult<Self>
fn parse_at_rule<I>(p: &mut Parser<'a, I>, c: Cursor) -> ParserResult<Self>
Like crate::Parse::parse() but with the additional context of the
name Cursor. This cursor is known to be
an AtKeyword, therefore this should return a Self reflecting a AtRule. If the
AtRule is not known, or otherwise fails then this should Err and RuleVariants::parse_unknown_at_rule() can
be called. Read moreSource§fn parse_unknown_at_rule<I>(
p: &mut Parser<'a, I>,
_name: Cursor,
) -> ParserResult<Self>
fn parse_unknown_at_rule<I>( p: &mut Parser<'a, I>, _name: Cursor, ) -> ParserResult<Self>
Like crate::Parse::parse() but with the additional context of the
name Cursor. This cursor is known to be
an AtKeyword and that RuleVariants::parse_at_rule() failed. This should therefore return a Self that represents
an Unknwon AtRule, or otherwise Err. Read moreSource§fn parse_qualified_rule<I>(
p: &mut Parser<'a, I>,
_name: Cursor,
) -> ParserResult<Self>
fn parse_qualified_rule<I>( p: &mut Parser<'a, I>, _name: Cursor, ) -> ParserResult<Self>
Like crate::Parse::parse() but with the additional context that the next cursor is not an
AtKeyword, therefore this can attempt to parse a Qualified Rule. If the rule
fails to parse, then RuleVariants::parse_unknown_qualified_rule() will be called. Read more
Source§fn parse_unknown_qualified_rule<I>(
p: &mut Parser<'a, I>,
_name: Cursor,
) -> ParserResult<Self>
fn parse_unknown_qualified_rule<I>( p: &mut Parser<'a, I>, _name: Cursor, ) -> ParserResult<Self>
Like crate::Parse::parse() but with the additional context that the next cursor is not an
AtKeyword, and that RuleVariants::parse_qualified_rule() has failed.
Therefore this should attempt to parse an Unknown Qualified Rule, or Err. Read more
Source§fn bad_declaration(_: BadDeclaration<'a>) -> Option<Self>
fn bad_declaration(_: BadDeclaration<'a>) -> Option<Self>
If all of the parse steps have failed, including parsing the Unknown Qualified Rule, we may want to consume a bad
declaration (especially if the parser is in a nested context). This is done automatically on failing to parse
an Unknown Qualified Rule, and this method is given the BadDeclaration. Read more
fn parse_rule_variants<I>(p: &mut Parser<'a, I>) -> Result<Self, Diagnostic>
Source§impl<'a> ToCursors for Rule<'a>
impl<'a> ToCursors for Rule<'a>
fn to_cursors(&self, s: &mut impl CursorSink)
impl<'a> Eq for Rule<'a>
impl<'a> StructuralPartialEq for Rule<'a>
Auto Trait Implementations§
impl<'a> Freeze for Rule<'a>
impl<'a> !RefUnwindSafe for Rule<'a>
impl<'a> !Send for Rule<'a>
impl<'a> !Sync for Rule<'a>
impl<'a> Unpin for Rule<'a>
impl<'a> !UnwindSafe for Rule<'a>
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