Skip to main content

AccessibilityBuilder

Struct AccessibilityBuilder 

Source
pub struct AccessibilityBuilder { /* private fields */ }

Implementations§

Source§

impl AccessibilityBuilder

Source

pub fn focusable(&mut self) -> &mut Self

Marks this element as focusable (adds to tab order).

Source

pub fn button(&mut self, label: &str) -> &mut Self

Sets role = Button and label in one call.

Source

pub fn heading(&mut self, label: &str, level: u8) -> &mut Self

Sets role = Heading with the given level (1–6) and label.

Sets role = Link and label.

Source

pub fn static_text(&mut self, label: &str) -> &mut Self

Sets role = StaticText and label. For read-only informational text.

Source

pub fn checkbox(&mut self, label: &str) -> &mut Self

Sets role = Checkbox, label, and focusable.

Source

pub fn slider(&mut self, label: &str) -> &mut Self

Sets role = Slider, label, and focusable.

Source

pub fn image(&mut self, alt: &str) -> &mut Self

Sets role = Image with an alt-text label.

Source

pub fn role(&mut self, role: AccessibilityRole) -> &mut Self

Sets the role explicitly.

Source

pub fn label(&mut self, label: &str) -> &mut Self

Sets the accessible label.

Source

pub fn description(&mut self, desc: &str) -> &mut Self

Sets the accessible description.

Source

pub fn value(&mut self, value: &str) -> &mut Self

Sets the current value (for sliders, progress bars, etc.).

Source

pub fn value_min(&mut self, min: f32) -> &mut Self

Sets the minimum value.

Source

pub fn value_max(&mut self, max: f32) -> &mut Self

Sets the maximum value.

Source

pub fn checked(&mut self, checked: bool) -> &mut Self

Sets the checked state (for checkboxes/radio buttons).

Source

pub fn tab_index(&mut self, index: i32) -> &mut Self

Sets the explicit tab index. Elements without a tab_index follow insertion order.

Source

pub fn focus_right(&mut self, target: impl Into<Id>) -> &mut Self

When the right arrow key is pressed while this element is focused, focus moves to the given target element.

Source

pub fn focus_left(&mut self, target: impl Into<Id>) -> &mut Self

When the left arrow key is pressed while this element is focused, focus moves to the given target element.

Source

pub fn focus_up(&mut self, target: impl Into<Id>) -> &mut Self

When the up arrow key is pressed while this element is focused, focus moves to the given target element.

Source

pub fn focus_down(&mut self, target: impl Into<Id>) -> &mut Self

When the down arrow key is pressed while this element is focused, focus moves to the given target element.

Source

pub fn disable_ring(&mut self) -> &mut Self

Disables the automatic focus ring on this element.

Source

pub fn ring_color(&mut self, color: impl Into<Color>) -> &mut Self

Sets the color of the focus ring. Default is red (255, 60, 40).

Source

pub fn ring_width(&mut self, width: u16) -> &mut Self

Sets the width (thickness) of the focus ring in pixels. Default is 2.

Source

pub fn live_region_polite(&mut self) -> &mut Self

Sets the live region to polite — screen reader announces changes on next idle.

Source

pub fn live_region_assertive(&mut self) -> &mut Self

Sets the live region to assertive — screen reader interrupts to announce changes.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more