Enum parcel_css::media_query::MediaFeature
source · [−]pub enum MediaFeature<'i> {
Plain {
name: CowArcStr<'i>,
value: MediaFeatureValue<'i>,
},
Boolean(CowArcStr<'i>),
Range {
name: CowArcStr<'i>,
operator: MediaFeatureComparison,
value: MediaFeatureValue<'i>,
},
Interval {
name: CowArcStr<'i>,
start: MediaFeatureValue<'i>,
start_operator: MediaFeatureComparison,
end: MediaFeatureValue<'i>,
end_operator: MediaFeatureComparison,
},
}
Expand description
Variants
Plain
A plain media feature, e.g. (min-width: 240px)
.
Boolean(CowArcStr<'i>)
A boolean feature, e.g. (hover)
.
Range
Fields
name: CowArcStr<'i>
The name of the feature.
operator: MediaFeatureComparison
A comparator.
value: MediaFeatureValue<'i>
The feature value.
A range, e.g. (width > 240px)
.
Interval
Fields
name: CowArcStr<'i>
The name of the feature.
start: MediaFeatureValue<'i>
A start value.
start_operator: MediaFeatureComparison
A comparator for the start value.
end: MediaFeatureValue<'i>
The end value.
end_operator: MediaFeatureComparison
A comparator for the end value.
An interval, e.g. (120px < width < 240px)
.
Trait Implementations
sourceimpl<'i> Clone for MediaFeature<'i>
impl<'i> Clone for MediaFeature<'i>
sourcefn clone(&self) -> MediaFeature<'i>
fn clone(&self) -> MediaFeature<'i>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'i> Debug for MediaFeature<'i>
impl<'i> Debug for MediaFeature<'i>
sourceimpl<'i> Parse<'i> for MediaFeature<'i>
impl<'i> Parse<'i> for MediaFeature<'i>
sourcefn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>(
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value of this type using an existing parser.
sourcefn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string. Read more
sourceimpl<'i> PartialEq<MediaFeature<'i>> for MediaFeature<'i>
impl<'i> PartialEq<MediaFeature<'i>> for MediaFeature<'i>
sourcefn eq(&self, other: &MediaFeature<'i>) -> bool
fn eq(&self, other: &MediaFeature<'i>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<'i> ToCss for MediaFeature<'i>
impl<'i> ToCss for MediaFeature<'i>
sourcefn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError> where
W: Write,
Serialize self
in CSS syntax, writing to dest
.
sourcefn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
Serialize self
in CSS syntax and return a string. Read more
impl<'i> StructuralPartialEq for MediaFeature<'i>
Auto Trait Implementations
impl<'i> RefUnwindSafe for MediaFeature<'i>
impl<'i> Send for MediaFeature<'i>
impl<'i> Sync for MediaFeature<'i>
impl<'i> Unpin for MediaFeature<'i>
impl<'i> UnwindSafe for MediaFeature<'i>
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer