#[non_exhaustive]pub enum A11yRole {
Show 24 variants
Window,
Toolbar,
Button,
Tab,
TabList,
Menu,
MenuItem,
Tree,
TreeItem,
List,
ListItem,
Table,
Row,
Cell,
TextInput,
Document,
Editor,
Terminal,
Dialog,
Status,
Progress,
Image,
Group,
Presentation,
}Expand description
A typed accessibility role, replacing a free-form role string.
Each variant maps 1:1 onto an accesskit::Role (see the a11y
cargo feature’s From<A11yRole> for accesskit::Role impl below) —
this enum is deliberately a subset of accesskit::Role’s much larger
vocabulary, scoped to what this crate’s own catalogue of primitives
actually needs. Editor and Document both map onto
accesskit::Role::Document: AccessKit has no separate “code editor”
role, and a multi-line editable document is what every AT actually
cares about. Presentation maps onto accesskit::Role::GenericContainer,
which is AccessKit’s equivalent of the ARIA none/presentation role —
an element an AT should skip over entirely.
#[non_exhaustive]: new roles are additive, not breaking. Construct
with one of the named variants; there is no catch-all “custom string”
escape hatch, deliberately — see the module doc.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Window
A top-level window or root application surface.
Toolbar
A toolbar grouping related actions.
Button
A clickable button.
Tab
A single tab within a Self::TabList.
TabList
A container of Self::Tabs.
Menu
A menu (menu bar entry, context menu, or submenu).
MenuItem
A single selectable entry within a Self::Menu.
Tree
A hierarchical tree of Self::TreeItems.
TreeItem
A single node within a Self::Tree.
List
A flat list of Self::ListItems.
ListItem
A single entry within a Self::List.
Table
A table of Self::Rows/Self::Cells.
Row
A row within a Self::Table.
Cell
A single cell within a Self::Table Self::Row.
TextInput
A single-line (or multi-line) editable text field.
Document
A read-mostly document surface (e.g. a rendered preview pane).
Editor
A multi-line editable document, such as a code editor. Maps onto
the same accesskit::Role::Document as Self::Document — see
this enum’s own doc for why AccessKit has no separate role.
Terminal
A VT-100-style terminal surface.
Dialog
A modal or non-modal dialog window.
Status
A status message region (e.g. a status bar).
Progress
A progress indicator.
Image
A non-interactive image.
Group
A generic grouping container with no more specific role.
Presentation
Decorative content an AT should skip — ARIA’s none/presentation.
Trait Implementations§
impl Copy for A11yRole
Source§impl<'de> Deserialize<'de> for A11yRole
impl<'de> Deserialize<'de> for A11yRole
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for A11yRole
impl StructuralPartialEq for A11yRole
Auto Trait Implementations§
impl Freeze for A11yRole
impl RefUnwindSafe for A11yRole
impl Send for A11yRole
impl Sync for A11yRole
impl Unpin for A11yRole
impl UnsafeUnpin for A11yRole
impl UnwindSafe for A11yRole
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more