Skip to main content

Role

Enum Role 

Source
#[non_exhaustive]
pub enum Role {
Show 44 variants Window, Group, Label, Heading, Button, Link, CheckBox, Switch, RadioGroup, RadioButton, TextInput, MultilineTextInput, Slider, SpinButton, ComboBox, ListBox, ListBoxOption, Menu, MenuBar, MenuItem, TabList, Tab, TabPanel, Dialog, Alert, Status, Tooltip, Toolbar, Grid, Table, Row, Cell, ColumnHeader, List, ListItem, Image, ProgressIndicator, Separator, ScrollView, Calendar, ContentInfo, Navigation, Tree, TreeItem,
}
Expand description

What kind of control or content a node is, as assistive technology names it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Window

The application window, the root of the tree.

§

Group

A container with no meaning of its own.

§

Label

Static text.

§

Heading

A heading; see AccessNode::level.

§

Button

Activates an action.

Navigates somewhere.

§

CheckBox

A two- or three-state check box.

§

Switch

An on/off switch.

§

RadioGroup

A set of radio buttons.

§

RadioButton

One choice of a radio group.

§

TextInput

Editable single-line text.

§

MultilineTextInput

Editable multi-line text.

§

Slider

A value picked along a track.

§

SpinButton

A number changed with increment and decrement buttons.

§

ComboBox

A field that opens a list of choices.

§

ListBox

A list of selectable options.

§

ListBoxOption

One option of a list box.

§

Menu

A popup menu.

§

MenuBar

A horizontal bar of menus.

§

MenuItem

One command in a menu.

§

TabList

A row of tabs.

§

Tab

One tab.

§

TabPanel

The content shown for the selected tab.

§

Dialog

A window over the app; see AccessNode::modal.

§

Alert

An urgent message.

§

Status

A status message (toasts).

§

Tooltip

A rich tooltip.

§

Toolbar

A row of controls.

§

Grid

A data grid.

§

Table

A static table.

§

Row

A row of a grid or table.

§

Cell

A cell of a grid or table.

§

ColumnHeader

A column header of a grid or table.

§

List

A list of items.

§

ListItem

One item of a list.

§

Image

An image; its name is the alternative text.

§

ProgressIndicator

Progress of a task.

§

Separator

A visual divider.

§

ScrollView

A region that scrolls.

§

Calendar

A date grid.

§

ContentInfo

The band that ends a page: copyright, links, version (a landmark).

§

Navigation

A set of links or buttons that move around the app (a landmark).

§

Tree

A list of items that can open to show more items.

§

TreeItem

One item of a tree; see AccessNode::level.

Implementations§

Source§

impl Role

Source

pub fn takes_name_from_content(self) -> bool

Roles whose accessible name comes from the text inside them when no explicit name is given, as in ARIA’s “name from content”.

Trait Implementations§

Source§

impl Clone for Role

Source§

fn clone(&self) -> Role

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 Copy for Role

Source§

impl Debug for Role

Source§

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

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

impl Eq for Role

Source§

impl Hash for Role

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Role

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

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§

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> AutoreleaseSafe for T
where T: ?Sized,

Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

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

§

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

Checks if this value is equivalent to the given key. 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.
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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