pub struct Environment {
pub media_type: MediaType,
pub width: f64,
pub height: f64,
pub device_width: f64,
pub device_height: f64,
pub resolution: f64,
pub color: u32,
pub color_index: u32,
pub monochrome: u32,
pub font_size: f64,
pub keywords: Vec<(&'static str, &'static str)>,
}Expand description
What a media query is evaluated against: the viewport and the device.
Environment::default is a 1280×720 colour screen at 1dppx with a
fine pointer that can hover, light colour scheme, no preferences set.
Fields§
§media_type: MediaTypescreen or print; every other media type matches nothing.
width: f64The viewport, in CSS pixels.
height: f64§device_width: f64The whole screen, in CSS pixels.
device_height: f64§resolution: f64Device pixels per CSS pixel.
color: u32Bits per colour component, 0 for a monochrome device.
color_index: u32§monochrome: u32Bits per pixel of a monochrome device, 0 otherwise.
font_size: f64The font size em in a media query is relative to, in pixels.
keywords: Vec<(&'static str, &'static str)>The value of each discrete feature, by name: hover to hover,
prefers-color-scheme to light. A feature not here is unknown.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§impl Debug for Environment
impl Debug for Environment
Source§impl Default for Environment
impl Default for Environment
Source§fn default() -> Environment
fn default() -> Environment
Returns the “default value” for a type. Read more
Source§impl PartialEq for Environment
impl PartialEq for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl Forget for Environment
impl Freeze for Environment
impl Move for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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
Mutably borrows from an owned value. Read more