Enum swc_css_ast::MediaFeature
source · [−]pub enum MediaFeature {
Plain(MediaFeaturePlain),
Boolean(MediaFeatureBoolean),
Range(MediaFeatureRange),
RangeInterval(MediaFeatureRangeInterval),
}
Variants
Plain(MediaFeaturePlain)
Boolean(MediaFeatureBoolean)
Range(MediaFeatureRange)
RangeInterval(MediaFeatureRangeInterval)
Implementations
sourceimpl MediaFeature
impl MediaFeature
sourcepub fn as_plain(&self) -> Option<&MediaFeaturePlain>
pub fn as_plain(&self) -> Option<&MediaFeaturePlain>
Returns Some
if self
is a reference of variant Plain
, and None
otherwise.
sourcepub fn as_mut_plain(&mut self) -> Option<&mut MediaFeaturePlain>
pub fn as_mut_plain(&mut self) -> Option<&mut MediaFeaturePlain>
Returns Some
if self
is a mutable reference of variant Plain
, and None
otherwise.
sourcepub fn expect_plain(self) -> MediaFeaturePlainwhere
Self: Debug,
pub fn expect_plain(self) -> MediaFeaturePlainwhere
Self: Debug,
sourcepub fn plain(self) -> Option<MediaFeaturePlain>
pub fn plain(self) -> Option<MediaFeaturePlain>
Returns Some
if self
is of variant Plain
, and None
otherwise.
sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Returns true
if self
is of variant Boolean
.
sourcepub fn as_boolean(&self) -> Option<&MediaFeatureBoolean>
pub fn as_boolean(&self) -> Option<&MediaFeatureBoolean>
Returns Some
if self
is a reference of variant Boolean
, and None
otherwise.
sourcepub fn as_mut_boolean(&mut self) -> Option<&mut MediaFeatureBoolean>
pub fn as_mut_boolean(&mut self) -> Option<&mut MediaFeatureBoolean>
Returns Some
if self
is a mutable reference of variant Boolean
, and None
otherwise.
sourcepub fn expect_boolean(self) -> MediaFeatureBooleanwhere
Self: Debug,
pub fn expect_boolean(self) -> MediaFeatureBooleanwhere
Self: Debug,
sourcepub fn boolean(self) -> Option<MediaFeatureBoolean>
pub fn boolean(self) -> Option<MediaFeatureBoolean>
Returns Some
if self
is of variant Boolean
, and None
otherwise.
sourcepub fn as_range(&self) -> Option<&MediaFeatureRange>
pub fn as_range(&self) -> Option<&MediaFeatureRange>
Returns Some
if self
is a reference of variant Range
, and None
otherwise.
sourcepub fn as_mut_range(&mut self) -> Option<&mut MediaFeatureRange>
pub fn as_mut_range(&mut self) -> Option<&mut MediaFeatureRange>
Returns Some
if self
is a mutable reference of variant Range
, and None
otherwise.
sourcepub fn expect_range(self) -> MediaFeatureRangewhere
Self: Debug,
pub fn expect_range(self) -> MediaFeatureRangewhere
Self: Debug,
sourcepub fn range(self) -> Option<MediaFeatureRange>
pub fn range(self) -> Option<MediaFeatureRange>
Returns Some
if self
is of variant Range
, and None
otherwise.
sourcepub fn is_range_interval(&self) -> bool
pub fn is_range_interval(&self) -> bool
Returns true
if self
is of variant RangeInterval
.
sourcepub fn as_range_interval(&self) -> Option<&MediaFeatureRangeInterval>
pub fn as_range_interval(&self) -> Option<&MediaFeatureRangeInterval>
Returns Some
if self
is a reference of variant RangeInterval
, and None
otherwise.
sourcepub fn as_mut_range_interval(
&mut self
) -> Option<&mut MediaFeatureRangeInterval>
pub fn as_mut_range_interval(
&mut self
) -> Option<&mut MediaFeatureRangeInterval>
Returns Some
if self
is a mutable reference of variant RangeInterval
, and None
otherwise.
sourcepub fn expect_range_interval(self) -> MediaFeatureRangeIntervalwhere
Self: Debug,
pub fn expect_range_interval(self) -> MediaFeatureRangeIntervalwhere
Self: Debug,
Unwraps the value, yielding the content of RangeInterval
.
Panics
Panics if the value is not RangeInterval
, with a panic message including the content of self
.
sourcepub fn range_interval(self) -> Option<MediaFeatureRangeInterval>
pub fn range_interval(self) -> Option<MediaFeatureRangeInterval>
Returns Some
if self
is of variant RangeInterval
, and None
otherwise.
Trait Implementations
sourceimpl Clone for MediaFeature
impl Clone for MediaFeature
sourcefn clone(&self) -> MediaFeature
fn clone(&self) -> MediaFeature
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more