pub struct Env {
pub viewport_width: f32,
pub viewport_height: f32,
pub dark: bool,
pub reduce_motion: bool,
pub scale_factor: f32,
pub display_mode: DisplayMode,
pub titlebar_area: Option<[f32; 4]>,
pub coarse_pointer: bool,
pub safe_area_insets: [f32; 4],
pub reduce_transparency: bool,
pub device_size: (f32, f32),
pub dynamic_range_high: bool,
}Fields§
§viewport_width: f32§viewport_height: f32§dark: bool§reduce_motion: bool§scale_factor: f32§display_mode: DisplayMode§titlebar_area: Option<[f32; 4]>None while the overlay is not visible (OS chrome, fullscreen, minimised): the variables are
then undefined and env(titlebar-area-height, 40px) takes its fallback, as in a browser.
coarse_pointer: boolThe primary pointer of a desktop window is always the mouse (pointer: fine, hover: hover); only any-pointer can widen to other hardware.
safe_area_insets: [f32; 4]Exists so env(safe-area-inset-*) from PWA sheets resolves: a fallback-less unknown env()
invalidates its declaration.
reduce_transparency: boolThe OS asks for opaque surfaces (Windows “Transparency effects” off, macOS “Reduce transparency”).
device_size: (f32, f32)device-width / device-height: the window’s monitor, CSS px.
dynamic_range_high: booldynamic-range: high: the window’s display is in HDR and the window can draw it.
Trait Implementations§
impl Copy for Env
impl StructuralPartialEq for Env
Auto Trait Implementations§
impl Forget for Env
impl Freeze for Env
impl Move for Env
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnsafeUnpin for Env
impl UnwindSafe for Env
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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