Enum swc_css_ast::Rule
source · [−]pub enum Rule {
QualifiedRule(Box<QualifiedRule>),
Invalid(Tokens),
AtRule(Box<AtRule>),
}
Variants
QualifiedRule(Box<QualifiedRule>)
Invalid(Tokens)
AtRule(Box<AtRule>)
Implementations
sourceimpl Rule
impl Rule
sourcepub fn is_qualified_rule(&self) -> bool
pub fn is_qualified_rule(&self) -> bool
Returns true
if self
is of variant QualifiedRule
.
sourcepub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
pub fn as_qualified_rule(&self) -> Option<&Box<QualifiedRule>>
Returns Some
if self
is a reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
pub fn as_mut_qualified_rule(&mut self) -> Option<&mut Box<QualifiedRule>>
Returns Some
if self
is a mutable reference of variant QualifiedRule
, and None
otherwise.
sourcepub fn expect_qualified_rule(self) -> Box<QualifiedRule>where
Self: Debug,
pub fn expect_qualified_rule(self) -> Box<QualifiedRule>where
Self: Debug,
Unwraps the value, yielding the content of QualifiedRule
.
Panics
Panics if the value is not QualifiedRule
, with a panic message including the content of self
.
sourcepub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
pub fn qualified_rule(self) -> Option<Box<QualifiedRule>>
Returns Some
if self
is of variant QualifiedRule
, and None
otherwise.
sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Returns true
if self
is of variant Invalid
.
sourcepub fn as_invalid(&self) -> Option<&Tokens>
pub fn as_invalid(&self) -> Option<&Tokens>
Returns Some
if self
is a reference of variant Invalid
, and None
otherwise.
sourcepub fn as_mut_invalid(&mut self) -> Option<&mut Tokens>
pub fn as_mut_invalid(&mut self) -> Option<&mut Tokens>
Returns Some
if self
is a mutable reference of variant Invalid
, and None
otherwise.
sourcepub fn expect_invalid(self) -> Tokenswhere
Self: Debug,
pub fn expect_invalid(self) -> Tokenswhere
Self: Debug,
sourcepub fn invalid(self) -> Option<Tokens>
pub fn invalid(self) -> Option<Tokens>
Returns Some
if self
is of variant Invalid
, and None
otherwise.
sourcepub fn is_at_rule(&self) -> bool
pub fn is_at_rule(&self) -> bool
Returns true
if self
is of variant AtRule
.
sourcepub fn as_at_rule(&self) -> Option<&Box<AtRule>>
pub fn as_at_rule(&self) -> Option<&Box<AtRule>>
Returns Some
if self
is a reference of variant AtRule
, and None
otherwise.
sourcepub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
pub fn as_mut_at_rule(&mut self) -> Option<&mut Box<AtRule>>
Returns Some
if self
is a mutable reference of variant AtRule
, and None
otherwise.