pub enum MediaFeature {
Plain(MediaFeaturePlain),
Boolean(MediaFeatureBoolean),
Range(MediaFeatureRange),
RangeInterval(MediaFeatureRangeInterval),
}
Variants§
Plain(MediaFeaturePlain)
Boolean(MediaFeatureBoolean)
Range(MediaFeatureRange)
RangeInterval(MediaFeatureRangeInterval)
Implementations§
Source§impl 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 const fn is_boolean(&self) -> bool
pub const 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 const fn is_range_interval(&self) -> bool
pub const 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§
Source§impl Clone for MediaFeature
impl Clone for MediaFeature
Source§fn clone(&self) -> MediaFeature
fn clone(&self) -> MediaFeature
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MediaFeature
impl Debug for MediaFeature
Source§impl EqIgnoreSpan for MediaFeature
impl EqIgnoreSpan for MediaFeature
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<MediaFeatureBoolean> for MediaFeature
impl From<MediaFeatureBoolean> for MediaFeature
Source§fn from(v: MediaFeatureBoolean) -> Self
fn from(v: MediaFeatureBoolean) -> Self
Source§impl From<MediaFeaturePlain> for MediaFeature
impl From<MediaFeaturePlain> for MediaFeature
Source§fn from(v: MediaFeaturePlain) -> Self
fn from(v: MediaFeaturePlain) -> Self
Source§impl From<MediaFeatureRange> for MediaFeature
impl From<MediaFeatureRange> for MediaFeature
Source§fn from(v: MediaFeatureRange) -> Self
fn from(v: MediaFeatureRange) -> Self
Source§impl From<MediaFeatureRangeInterval> for MediaFeature
impl From<MediaFeatureRangeInterval> for MediaFeature
Source§fn from(v: MediaFeatureRangeInterval) -> Self
fn from(v: MediaFeatureRangeInterval) -> Self
Source§impl Hash for MediaFeature
impl Hash for MediaFeature
Source§impl PartialEq for MediaFeature
impl PartialEq for MediaFeature
Source§impl Spanned for MediaFeature
impl Spanned for MediaFeature
impl Eq for MediaFeature
impl StructuralPartialEq for MediaFeature
Auto Trait Implementations§
impl Freeze for MediaFeature
impl RefUnwindSafe for MediaFeature
impl Send for MediaFeature
impl Sync for MediaFeature
impl Unpin for MediaFeature
impl UnwindSafe for MediaFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more