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§
Sourcefn get_accessibility_data(&mut self) -> &mut AccessibilityData
fn get_accessibility_data(&mut self) -> &mut AccessibilityData
Returns a mutable reference to the element’s accessibility data.
Provided Methods§
Sourcefn accessibility(self, accessibility: AccessibilityData) -> Self
fn accessibility(self, accessibility: AccessibilityData) -> Self
Replace all of the element’s accessibility data at once. See AccessibilityData.
Sourcefn a11y_id(self, a11y_id: impl Into<Option<AccessibilityId>>) -> Self
fn a11y_id(self, a11y_id: impl Into<Option<AccessibilityId>>) -> Self
Set an explicit accessibility id instead of an autogenerated one. See AccessibilityId.
Sourcefn a11y_focusable(self, a11y_focusable: impl Into<Focusable>) -> Self
fn a11y_focusable(self, a11y_focusable: impl Into<Focusable>) -> Self
Set whether the element can receive keyboard focus. See Focusable.
Sourcefn a11y_auto_focus(self, a11y_auto_focus: impl Into<bool>) -> Self
fn a11y_auto_focus(self, a11y_auto_focus: impl Into<bool>) -> Self
Request that the element be focused automatically when it is mounted.
Sourcefn a11y_member_of(self, a11y_member_of: impl Into<AccessibilityId>) -> Self
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.
Sourcefn a11y_role(self, a11y_role: impl Into<AccessibilityRole>) -> Self
fn a11y_role(self, a11y_role: impl Into<AccessibilityRole>) -> Self
Set the accessibility role exposed in the accessibility tree. See AccessibilityRole.
Sourcefn a11y_alt(self, value: impl Into<Box<str>>) -> Self
fn a11y_alt(self, value: impl Into<Box<str>>) -> Self
Set the text label that describes the element in the accessibility tree.
Sourcefn a11y_builder(self, with: impl FnOnce(&mut Node)) -> Self
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.