Skip to main content

AccessibilityExt

Trait AccessibilityExt 

Source
pub trait AccessibilityExt: Sized {
    // Required method
    fn get_accessibility_data(&mut self) -> &mut AccessibilityData;

    // Provided methods
    fn accessibility(self, accessibility: AccessibilityData) -> Self { ... }
    fn a11y_id(self, a11y_id: impl Into<Option<AccessibilityId>>) -> Self { ... }
    fn a11y_focusable(self, a11y_focusable: impl Into<Focusable>) -> Self { ... }
    fn a11y_auto_focus(self, a11y_auto_focus: impl Into<bool>) -> Self { ... }
    fn a11y_member_of(self, a11y_member_of: impl Into<AccessibilityId>) -> Self { ... }
    fn a11y_role(self, a11y_role: impl Into<AccessibilityRole>) -> Self { ... }
    fn a11y_alt(self, value: impl Into<Box<str>>) -> Self { ... }
    fn a11y_builder(self, with: impl FnOnce(&mut Node)) -> Self { ... }
}
Expand description

Methods for describing an element in the accessibility tree.

Required Methods§

Source

fn get_accessibility_data(&mut self) -> &mut AccessibilityData

Returns a mutable reference to the element’s accessibility data.

Provided Methods§

Source

fn accessibility(self, accessibility: AccessibilityData) -> Self

Replace all of the element’s accessibility data at once. See AccessibilityData.

Source

fn a11y_id(self, a11y_id: impl Into<Option<AccessibilityId>>) -> Self

Set an explicit accessibility id instead of an autogenerated one. See AccessibilityId.

Source

fn a11y_focusable(self, a11y_focusable: impl Into<Focusable>) -> Self

Set whether the element can receive keyboard focus. See Focusable.

Source

fn a11y_auto_focus(self, a11y_auto_focus: impl Into<bool>) -> Self

Request that the element be focused automatically when it is mounted.

Source

fn a11y_member_of(self, a11y_member_of: impl Into<AccessibilityId>) -> Self

Mark the element as a member of the group identified by the given AccessibilityId.

Source

fn a11y_role(self, a11y_role: impl Into<AccessibilityRole>) -> Self

Set the accessibility role exposed in the accessibility tree. See AccessibilityRole.

Source

fn a11y_alt(self, value: impl Into<Box<str>>) -> Self

Set the text label that describes the element in the accessibility tree.

Source

fn a11y_builder(self, with: impl FnOnce(&mut Node)) -> Self

Edit the underlying accesskit node directly for advanced accessibility properties.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§