pub struct MediaQuery<'i> {
pub qualifier: Option<Qualifier>,
pub media_type: MediaType<'i>,
pub condition: Option<MediaCondition<'i>>,
}Expand description
A media query.
Fields§
§qualifier: Option<Qualifier>The qualifier for this query.
media_type: MediaType<'i>The media type for this query, that can be known, unknown, or “all”.
condition: Option<MediaCondition<'i>>The condition that this media query contains. This cannot have or
in the first level.
Implementations§
Source§impl<'i> MediaQuery<'i>
impl<'i> MediaQuery<'i>
Sourcepub fn parse<'t>(
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i, ParserError<'i>>>
pub fn parse<'t>( input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a media query given css input.
Returns an error if any of the expressions is unknown.
Sourcepub fn always_matches(&self) -> bool
pub fn always_matches(&self) -> bool
Returns whether the media query is guaranteed to always match.
Sourcepub fn never_matches(&self) -> bool
pub fn never_matches(&self) -> bool
Returns whether the media query is guaranteed to never match.
Trait Implementations§
Source§impl<'i> Clone for MediaQuery<'i>
impl<'i> Clone for MediaQuery<'i>
Source§fn clone(&self) -> MediaQuery<'i>
fn clone(&self) -> MediaQuery<'i>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'i> Debug for MediaQuery<'i>
impl<'i> Debug for MediaQuery<'i>
Source§impl<'i> PartialEq for MediaQuery<'i>
impl<'i> PartialEq for MediaQuery<'i>
Source§fn eq(&self, other: &MediaQuery<'i>) -> bool
fn eq(&self, other: &MediaQuery<'i>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'i> ToCss for MediaQuery<'i>
impl<'i> ToCss for MediaQuery<'i>
Source§fn 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.Source§fn 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 moreimpl<'i> StructuralPartialEq for MediaQuery<'i>
Auto Trait Implementations§
impl<'i> Freeze for MediaQuery<'i>
impl<'i> RefUnwindSafe for MediaQuery<'i>
impl<'i> Send for MediaQuery<'i>
impl<'i> Sync for MediaQuery<'i>
impl<'i> Unpin for MediaQuery<'i>
impl<'i> UnsafeUnpin for MediaQuery<'i>
impl<'i> UnwindSafe for MediaQuery<'i>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§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.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
Converts
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>
Converts
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