Enum swc_css_ast::Rule
source · pub enum Rule {
QualifiedRule(Box<QualifiedRule>),
AtRule(Box<AtRule>),
ListOfComponentValues(Box<ListOfComponentValues>),
}
Variants§
QualifiedRule(Box<QualifiedRule>)
AtRule(Box<AtRule>)
ListOfComponentValues(Box<ListOfComponentValues>)
Implementations§
source§impl 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_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.
sourcepub fn expect_at_rule(self) -> Box<AtRule>where
Self: Debug,
pub fn expect_at_rule(self) -> Box<AtRule>where
Self: Debug,
sourcepub fn at_rule(self) -> Option<Box<AtRule>>
pub fn at_rule(self) -> Option<Box<AtRule>>
Returns Some
if self
is of variant AtRule
, and None
otherwise.
sourcepub fn is_list_of_component_values(&self) -> bool
pub fn is_list_of_component_values(&self) -> bool
Returns true
if self
is of variant ListOfComponentValues
.
sourcepub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
pub fn as_list_of_component_values(&self) -> Option<&Box<ListOfComponentValues>>
Returns Some
if self
is a reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn as_mut_list_of_component_values(
&mut self
) -> Option<&mut Box<ListOfComponentValues>>
pub fn as_mut_list_of_component_values(
&mut self
) -> Option<&mut Box<ListOfComponentValues>>
Returns Some
if self
is a mutable reference of variant ListOfComponentValues
, and None
otherwise.
sourcepub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where
Self: Debug,
pub fn expect_list_of_component_values(self) -> Box<ListOfComponentValues>where
Self: Debug,
Unwraps the value, yielding the content of ListOfComponentValues
.
Panics
Panics if the value is not ListOfComponentValues
, with a panic message including the content of self
.
sourcepub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
pub fn list_of_component_values(self) -> Option<Box<ListOfComponentValues>>
Returns Some
if self
is of variant ListOfComponentValues
, and None
otherwise.