Enum swc_css_ast::DeclarationOrAtRule
source · pub enum DeclarationOrAtRule {
Declaration(Box<Declaration>),
AtRule(Box<AtRule>),
ListOfComponentValues(Box<ListOfComponentValues>),
}
Variants§
Declaration(Box<Declaration>)
AtRule(Box<AtRule>)
ListOfComponentValues(Box<ListOfComponentValues>)
Implementations§
source§impl DeclarationOrAtRule
impl DeclarationOrAtRule
sourcepub const fn is_declaration(&self) -> bool
pub const fn is_declaration(&self) -> bool
Returns true
if self
is of variant Declaration
.
sourcepub fn as_declaration(&self) -> Option<&Box<Declaration>>
pub fn as_declaration(&self) -> Option<&Box<Declaration>>
Returns Some
if self
is a reference of variant Declaration
, and None
otherwise.
sourcepub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
pub fn as_mut_declaration(&mut self) -> Option<&mut Box<Declaration>>
Returns Some
if self
is a mutable reference of variant Declaration
, and None
otherwise.
sourcepub fn expect_declaration(self) -> Box<Declaration>where
Self: Debug,
pub fn expect_declaration(self) -> Box<Declaration>where Self: Debug,
Unwraps the value, yielding the content of Declaration
.
Panics
Panics if the value is not Declaration
, with a panic message including the content of self
.
sourcepub fn declaration(self) -> Option<Box<Declaration>>
pub fn declaration(self) -> Option<Box<Declaration>>
Returns Some
if self
is of variant Declaration
, and None
otherwise.
sourcepub const fn is_at_rule(&self) -> bool
pub const 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 const fn is_list_of_component_values(&self) -> bool
pub const 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.
Trait Implementations§
source§impl Clone for DeclarationOrAtRule
impl Clone for DeclarationOrAtRule
source§fn clone(&self) -> DeclarationOrAtRule
fn clone(&self) -> DeclarationOrAtRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeclarationOrAtRule
impl Debug for DeclarationOrAtRule
source§impl<'de> Deserialize<'de> for DeclarationOrAtRule
impl<'de> Deserialize<'de> for DeclarationOrAtRule
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl EqIgnoreSpan for DeclarationOrAtRule
impl EqIgnoreSpan for DeclarationOrAtRule
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<Box<Declaration, Global>> for DeclarationOrAtRule
impl From<Box<Declaration, Global>> for DeclarationOrAtRule
source§fn from(v: Box<Declaration>) -> Self
fn from(v: Box<Declaration>) -> Self
source§impl From<Box<ListOfComponentValues, Global>> for DeclarationOrAtRule
impl From<Box<ListOfComponentValues, Global>> for DeclarationOrAtRule
source§fn from(v: Box<ListOfComponentValues>) -> Self
fn from(v: Box<ListOfComponentValues>) -> Self
source§impl From<DeclarationOrAtRule> for ComponentValue
impl From<DeclarationOrAtRule> for ComponentValue
source§fn from(rule: DeclarationOrAtRule) -> Self
fn from(rule: DeclarationOrAtRule) -> Self
source§impl Hash for DeclarationOrAtRule
impl Hash for DeclarationOrAtRule
source§impl PartialEq<DeclarationOrAtRule> for DeclarationOrAtRule
impl PartialEq<DeclarationOrAtRule> for DeclarationOrAtRule
source§fn eq(&self, other: &DeclarationOrAtRule) -> bool
fn eq(&self, other: &DeclarationOrAtRule) -> bool
self
and other
values to be equal, and is used
by ==
.