pub struct Environment {
pub theme: Theme,
pub layout_direction: LayoutDirection,
pub scale_factor: f32,
pub prefers_high_contrast: bool,
pub prefers_reduced_motion: bool,
pub prefers_large_text: bool,
pub prefers_touch: Option<bool>,
pub screen_reader: ScreenReaderState,
pub explore_by_touch: ExploreByTouch,
}Expand description
Environment data that flows down the widget tree. Subtrees can override parts of the environment.
Fields§
§theme: Theme§layout_direction: LayoutDirection§scale_factor: f32§prefers_high_contrast: bool§prefers_reduced_motion: bool§prefers_large_text: bool§prefers_touch: Option<bool>The OS’s stated preference for a touch-first UI (Windows tablet mode,
a convertible in slate posture), or None when the platform does not
report one.
Nothing writes it and nothing reads it yet: it is the input to a
density policy the framework does not act on — see
WidgetTree::set_density_policy.
screen_reader: ScreenReaderStateWhether an assistive technology is attached. See ScreenReaderState.
explore_by_touch: ExploreByTouchWhether the platform’s touch-exploration mode is on. See
ExploreByTouch.
Implementations§
Source§impl Environment
impl Environment
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
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 Debug for Environment
impl Debug for Environment
Auto Trait Implementations§
impl !RefUnwindSafe for Environment
impl !Send for Environment
impl !Sync for Environment
impl !UnwindSafe for Environment
impl Freeze for Environment
impl Unpin for Environment
impl UnsafeUnpin 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