Enum Role
#[non_exhaustive]pub enum Role {
Show 41 variants
Window,
Dialog,
Group,
Generic,
Toolbar,
TabBar,
Tab,
TabPanel,
List,
ListItem,
Table,
Row,
Cell,
Tree,
TreeItem,
Menu,
MenuItem,
Button,
ToggleButton,
Checkbox,
RadioButton,
Switch,
Slider,
Separator,
SpinButton,
ComboBox,
TextInput,
MultilineTextInput,
Link,
ProgressBar,
Spinner,
Tooltip,
Image,
Label,
StaticText,
Heading {
level: u8,
},
Paragraph,
Document,
Terminal,
Canvas,
Unknown,
}Expand description
A thin subset of AccessKit’s 182 roles covering the widgets the toolkit
supports; unknown/rare cases fall back to Role::Generic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Window
Dialog
Group
Generic
Prefer returning None from accessibility() for pure layout widgets
so they collapse out of the tree; Generic is for a rare container
with no richer role that must still appear.
Toolbar
TabBar
Tab
TabPanel
The panel a selected Role::Tab reveals.
List
ListItem
Table
Row
Within a Role::Table or Role::Tree.
Cell
Tree
TreeItem
Menu
MenuItem
Button
ToggleButton
Persistent pressed/unpressed state (use AccessState::checked).
Checkbox
Use AccessState::checked.
RadioButton
Use AccessState::checked.
Switch
Use AccessState::checked.
Slider
Separator
A focusable divider between two panes that moves with the arrow keys; its value is the first pane’s share in percent.
SpinButton
ComboBox
TextInput
MultilineTextInput
Own role because AccessKit distinguishes it from Role::TextInput.
Link
ProgressBar
Determinate, or with AccessState::busy, indeterminate.
Spinner
Tooltip
Image
Supply alt text via name.
Label
A short text label that names another control.
StaticText
Heading
Outline level (1 = top level), for heading navigation.
Paragraph
Document
E.g. the block editor.
Terminal
A terminal transcript and input surface. Unlike a text input, its
exposed value is not replaced by Action::SetValue; input is a
stream owned by the terminal’s resource/action contract.
Canvas
Unknown
Trait Implementations§
§impl Serialize for Role
impl Serialize for Role
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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