Skip to main content

A11yRole

Enum A11yRole 

Source
pub enum A11yRole {
Show 35 variants Button, Link, TextInput, TextArea, Checkbox, Switch, Radio, RadioGroup, Slider, ProgressBar, ComboBox, ListBox, ListItem, MenuBar, Menu, MenuItem, MenuItemCheckbox, MenuItemRadio, Tab, TabList, TabPanel, Tree, TreeItem, Toolbar, Dialog, AlertDialog, Tooltip, Status, Alert, Label, Heading, Group, Region, Landmark, Generic,
}
Expand description

Explicit accessibility role override. Maps to [accesskit::Role] through the From<A11yRole> for accesskit::Role impl in lumen-a11y-accesskit.

  • Absent component: role derived from primitives (TextInput -> text input, Toggleable -> switch/checkbox, SliderValue -> slider, etc.).
  • Present component: this value wins. Markup author can pin a role with role="dialog".

Variants§

§

Button

Push button.

Hyperlink.

§

TextInput

Single-line text input. Distinct from Self::TextArea so screen readers can announce single- vs multi-line behaviour.

§

TextArea

Multi-line text area.

§

Checkbox

Two-state checkbox.

§

Switch

Two-state on/off switch (checkbox semantics, switch presentation). Distinct from Self::Checkbox so assistive tech announces it as a switch (Role::Switch) - the role <switch> pins explicitly.

§

Radio

Single radio button. Pair with Self::RadioGroup.

§

RadioGroup

Container for a set of Self::Radio options.

§

Slider

Continuous bounded scalar control.

§

ProgressBar

Read-only progress indicator.

§

ComboBox

Drop-down combobox.

§

ListBox

Selectable list.

§

ListItem

One row in a Self::ListBox or Self::Tree.

§

MenuBar

Top-level menu bar (typically a window’s main menu).

§

Menu

Sub-menu container.

§

MenuItem

Action menu entry.

§

MenuItemCheckbox

Toggleable menu entry (checkbox-style).

§

MenuItemRadio

Menu entry inside a radio group.

§

Tab

Tab strip entry.

§

TabList

Container for Self::Tab entries.

§

TabPanel

Panel revealed by an active Self::Tab.

§

Tree

Tree container.

§

TreeItem

Single row inside a Self::Tree; use A11yLevel for depth.

§

Toolbar

Toolbar (typically a horizontal strip of Self::Buttons).

§

Dialog

Modal or modeless dialog.

§

AlertDialog

Alert dialog (modal, error-style).

§

Tooltip

Tooltip surface.

§

Status

Polite status region (live-region default).

§

Alert

Assertive alert region (live-region default).

§

Label

Visible label (typically associated via A11yRelations.labelled_by).

§

Heading

Heading; pair with A11yLevel for <h1>..<h6> depth.

§

Group

Generic grouping container (<fieldset>, <section>).

§

Region

Named landmark region (<aside>, <section role=region>).

§

Landmark

Page landmark (<header>, <footer>, <nav>, <main>).

§

Generic

Default generic container with no semantic role.

Trait Implementations§

Source§

impl Clone for A11yRole

Source§

fn clone(&self) -> A11yRole

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 Component for A11yRole
where Self: Send + Sync + 'static,

Source§

const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table

A constant indicating the storage type used for this component.
Source§

type Mutability = Mutable

A marker type to assist Bevy with determining if this component is mutable, or immutable. Mutable components will have Component<Mutability = Mutable>, while immutable components will instead have Component<Mutability = Immutable>. Read more
Source§

fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )

Registers required components. Read more
Source§

fn clone_behavior() -> ComponentCloneBehavior

Called when registering this component, allowing to override clone function (or disable cloning altogether) for this component. Read more
Source§

fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)

Maps the entities on this component using the given EntityMapper. This is used to remap entities in contexts like scenes and entity cloning. When deriving Component, this is populated by annotating fields containing entities with #[entities] Read more
Source§

fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>

Returns [ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more
§

fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_add [ComponentHook] for this Component if one is defined.
§

fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_insert [ComponentHook] for this Component if one is defined.
§

fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_discard [ComponentHook] for this Component if one is defined.
§

fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_remove [ComponentHook] for this Component if one is defined.
§

fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>

Gets the on_despawn [ComponentHook] for this Component if one is defined.
Source§

impl Debug for A11yRole

Source§

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

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

impl From<&SliderValue> for A11yRole

Source§

fn from(_: &SliderValue) -> Self

Converts to this type from the input type.
Source§

impl From<&TextInput> for A11yRole

Source§

fn from(t: &TextInput) -> Self

Converts to this type from the input type.
Source§

impl From<&Toggleable> for A11yRole

Source§

fn from(_: &Toggleable) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for A11yRole

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for A11yRole

Source§

impl Eq for A11yRole

Source§

impl StructuralPartialEq for A11yRole

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
§

impl<C> Bundle for C
where C: Component,

§

fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>

§

fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>

Return a iterator over this Bundle’s component ids. This will be None if the component has not been registered.
§

impl<C> BundleFromComponents for C
where C: Component,

§

unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>,

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
§

impl<T> DynEq for T
where T: Any + Eq,

§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
§

impl<C> DynamicBundle for C
where C: Component,

§

type Effect = ()

An operation on the entity that happens after inserting this bundle.
§

unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect

Moves the components out of the bundle. Read more
§

unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )

Applies the after-effects of spawning this bundle. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
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 = 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.
§

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