Enum swc_css_ast::MediaInParens
source · [−]pub enum MediaInParens {
MediaCondition(MediaCondition),
Feature(Box<MediaFeature>),
GeneralEnclosed(GeneralEnclosed),
}
Variants
MediaCondition(MediaCondition)
Feature(Box<MediaFeature>)
GeneralEnclosed(GeneralEnclosed)
Implementations
sourceimpl MediaInParens
impl MediaInParens
sourcepub fn is_media_condition(&self) -> bool
pub fn is_media_condition(&self) -> bool
Returns true
if self
is of variant MediaCondition
.
sourcepub fn as_media_condition(&self) -> Option<&MediaCondition>
pub fn as_media_condition(&self) -> Option<&MediaCondition>
Returns Some
if self
is a reference of variant MediaCondition
, and None
otherwise.
sourcepub fn as_mut_media_condition(&mut self) -> Option<&mut MediaCondition>
pub fn as_mut_media_condition(&mut self) -> Option<&mut MediaCondition>
Returns Some
if self
is a mutable reference of variant MediaCondition
, and None
otherwise.
sourcepub fn expect_media_condition(self) -> MediaConditionwhere
Self: Debug,
pub fn expect_media_condition(self) -> MediaConditionwhere
Self: Debug,
Unwraps the value, yielding the content of MediaCondition
.
Panics
Panics if the value is not MediaCondition
, with a panic message including the content of self
.
sourcepub fn media_condition(self) -> Option<MediaCondition>
pub fn media_condition(self) -> Option<MediaCondition>
Returns Some
if self
is of variant MediaCondition
, and None
otherwise.
sourcepub fn is_feature(&self) -> bool
pub fn is_feature(&self) -> bool
Returns true
if self
is of variant Feature
.
sourcepub fn as_feature(&self) -> Option<&Box<MediaFeature>>
pub fn as_feature(&self) -> Option<&Box<MediaFeature>>
Returns Some
if self
is a reference of variant Feature
, and None
otherwise.
sourcepub fn as_mut_feature(&mut self) -> Option<&mut Box<MediaFeature>>
pub fn as_mut_feature(&mut self) -> Option<&mut Box<MediaFeature>>
Returns Some
if self
is a mutable reference of variant Feature
, and None
otherwise.
sourcepub fn expect_feature(self) -> Box<MediaFeature>where
Self: Debug,
pub fn expect_feature(self) -> Box<MediaFeature>where
Self: Debug,
sourcepub fn feature(self) -> Option<Box<MediaFeature>>
pub fn feature(self) -> Option<Box<MediaFeature>>
Returns Some
if self
is of variant Feature
, and None
otherwise.
sourcepub fn is_general_enclosed(&self) -> bool
pub fn is_general_enclosed(&self) -> bool
Returns true
if self
is of variant GeneralEnclosed
.
sourcepub fn as_general_enclosed(&self) -> Option<&GeneralEnclosed>
pub fn as_general_enclosed(&self) -> Option<&GeneralEnclosed>
Returns Some
if self
is a reference of variant GeneralEnclosed
, and None
otherwise.
sourcepub fn as_mut_general_enclosed(&mut self) -> Option<&mut GeneralEnclosed>
pub fn as_mut_general_enclosed(&mut self) -> Option<&mut GeneralEnclosed>
Returns Some
if self
is a mutable reference of variant GeneralEnclosed
, and None
otherwise.
sourcepub fn expect_general_enclosed(self) -> GeneralEnclosedwhere
Self: Debug,
pub fn expect_general_enclosed(self) -> GeneralEnclosedwhere
Self: Debug,
Unwraps the value, yielding the content of GeneralEnclosed
.
Panics
Panics if the value is not GeneralEnclosed
, with a panic message including the content of self
.
sourcepub fn general_enclosed(self) -> Option<GeneralEnclosed>
pub fn general_enclosed(self) -> Option<GeneralEnclosed>
Returns Some
if self
is of variant GeneralEnclosed
, and None
otherwise.
Trait Implementations
sourceimpl Clone for MediaInParens
impl Clone for MediaInParens
sourcefn clone(&self) -> MediaInParens
fn clone(&self) -> MediaInParens
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more