Skip to main content

Accessibility

Struct Accessibility 

Source
pub struct Accessibility {
    pub bold_text: bool,
    pub high_contrast: bool,
    pub disable_animations: bool,
    pub invert_colors: bool,
    pub accessible_navigation: bool,
    pub always_use_24_hour_format: bool,
}
Expand description

The accessibility settings the platform reports about its user.

The reference carries these on MediaQueryData as separate booleans; they are one struct here because they arrive from one query and are read together, and because a widget that honours one usually honours its neighbours.

Honoured by the framework: disable_animations. The rest are reported for the application to act on — saying so is more useful than a field that looks obeyed and is not.

Fields§

§bold_text: bool

The user has asked for heavier text everywhere.

§high_contrast: bool

The user has asked for higher contrast than the design’s own.

§disable_animations: bool

The user has asked for motion to be reduced or removed.

The framework honours this for its implicit animations — the ones a widget starts by itself when a value changes — by completing them at once instead of over time. The change still happens; it stops moving. That is what the setting asks for, and skipping the change instead would leave the interface wrong rather than still.

§invert_colors: bool

The user has asked for inverted colours.

§accessible_navigation: bool

Something is reading the screen aloud, or otherwise driving it without a pointer.

A hint rather than an instruction: it is how an interface knows that a control which only appears on hover will never appear.

§always_use_24_hour_format: bool

The user’s clock format — true for 24-hour, false for 12.

Implementations§

Source§

impl Accessibility

Source

pub const NONE: Self

Nothing asked for: the settings of a user who has changed none of them.

Source

pub fn with_overrides(self, over: AccessibilityOverrides) -> Self

The platform’s answer with an application’s AccessibilityOverrides laid over it.

Trait Implementations§

Source§

impl Clone for Accessibility

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Accessibility

Source§

impl Debug for Accessibility

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Accessibility

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Accessibility

Source§

impl PartialEq for Accessibility

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Accessibility

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.