Role

Enum Role 

Source
pub enum Role {
Show 100 variants Alert, AlertDialog, Application, Article, AssociationList, AssociationListItemKey, AssociationListItemValue, Banner, Blockquote, Button, Caption, Cell, Checkbox, Code, ColumnHeader, Combobox, Command, Comment, Complementary, Composite, ContentInfo, Definition, Deletion, Dialog, Document, Emphasis, Feed, Figure, Form, Generic, Grid, GridCell, Group, Heading, Image, Img, Input, Insertion, Landmark, Link, List, Listbox, ListItem, Log, Main, Mark, Marquee, Math, Menu, Menubar, MenuItem, MenuItemCheckbox, MenuItemRadio, Meter, Navigation, None, Note, Option, Paragraph, Presentation, Progressbar, Radio, RadioGroup, Range, Region, Roletype, Row, RowGroup, RowHeader, Scrollbar, Search, Searchbox, Section, SectionHead, Select, Separator, Slider, SpinButton, Status, Strong, Structure, Subscript, Suggestion, Superscript, Switch, Tab, Table, TabList, TabPanel, Term, Textbox, Time, Timer, Toolbar, Tooltip, Tree, TreeGrid, TreeItem, Widget, Window,
}
Expand description

The aria role of the element.

https://w3c.github.io/aria/#role_definitions

Variants§

§

Alert

A type of live region with important, and usually time-sensitive, information. See related Role::AlertDialog and Role::Status.

§

AlertDialog

A type of dialog that contains an alert message, where initial focus goes to an element within the dialog. See related Role::Alert and Role::Dialog.

§

Application

A structure containing one or more focusable elements requiring user input, such as keyboard or gesture events, that do not follow a standard interaction pattern supported by a Role::Widget role.

§

Article

A section of a page that consists of a composition that forms an independent part of a document, page, or site.

§

AssociationList

§

AssociationListItemKey

A single key item in an association list.

§

AssociationListItemValue

A single value item in an association list.

§

Banner

A landmark that contains mostly site-oriented content, rather than page-specific content.

§

Blockquote

A section of content that is quoted from another source.

§

Button

An input that allows for user-triggered actions when clicked or pressed. See related Role::Link.

§

Caption

Visible content that names, or describes a Role::Group, Role::Figure, Role::Table, Role::Grid, Role::RadioGroup, or Role::TreeGrid.

§

Cell

A cell in a tabular container. See related Role::GridCell.

§

Checkbox

A checkable input that has three possible values: true, false, or mixed.

§

Code

A section whose content represents a fragment of computer code.

§

ColumnHeader

A cell containing header information for a column.

§

Combobox

An input that controls another element, such as a Role::Listbox or Role::Grid, that can dynamically pop up to help the user set the value of the Role::Input.

§

Command

A form of Role::Widget that performs an action but does not receive input data.

§

Comment

A comment contains content expressing reaction to other content.

§

Complementary

A Role::Landmark that is designed to be complementary to the main content that it is a sibling to, or a direct descendant of. The contents of a complementary landmark would be expected to remain meaningful if it were to be separated from the main content it is relevant to.

§

Composite

A Role::Widget that can contain navigable descendants or owned children.

§

ContentInfo

A Role::Landmark that contains information about the parent document.

§

Definition

A definition of a term or concept. See related Role::Term.

§

Deletion

A deletion represents content that is marked as removed, content that is being suggested for removal, or content that is no longer relevant in the context of its accompanying content. See related Role::Insertion.

§

Dialog

A dialog is a descendant window of the primary window of a web application. For HTML pages, the primary application window is the entire web document, i.e., the body element.

§

Document

An element containing content that assistive technology users might want to browse in a reading mode.

§

Emphasis

One or more emphasized characters. See related Role::Strong.

§

Feed

A scrollable Role::List of Role::Articles where scrolling might cause Role::Articles to be added to or removed from either end of the list.

§

Figure

A perceivable Role::Section of content that typically contains a graphical document, images, media player, code snippets, or example text. The parts of a figure MAY be user-navigable.

§

Form

A Role::Landmark region that contains a collection of items and objects that, as a whole, combine to create a form. See related Role::Search.

§

Generic

A nameless container element that has no semantic meaning on its own.

§

Grid

A composite Role::Widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys.

§

GridCell

§

Group

A set of user interface objects that is not intended to be included in a page summary or table of contents by assistive technologies.

§

Heading

A heading for a section of the page.

§

Image

A container for a collection of elements that form an image. See synonym Role::Img.

§

Img

A container for a collection of elements that form an image. See synonym Role::Image.

§

Input

A generic type of Role::Widget that allows user input.

§

Insertion

An insertion contains content that is marked as added or content that is being suggested for addition. See related Role::Deletion.

§

Landmark

A perceivable Role::Section containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.

An interactive reference to an internal or external resource that, when activated, causes the user agent to navigate to that resource. See related Role::Button.

§

List

A Role::Section containing Role::ListItem elements. See related Role::Listbox.

§

Listbox

A Role::Widget that allows the user to select one or more items from a list of choices. See related Role::Combobox and list.

§

ListItem

A single item in a list or directory.

§

Log

A type of live region where new information is added in meaningful order and old information can disappear. See related Role::Marquee.

§

Main

A Role::Landmark containing the main content of a document.

§

Mark

Content which is marked or highlighted for reference or notation purposes, due to the content’s relevance in the enclosing context.

§

Marquee

A type of live region where non-essential information changes frequently. See related Role::Log.

§

Math

Content that represents a mathematical expression.

§

Menu

A type of Role::Widget that offers a list of choices to the user.

§

Menubar

A presentation of Role::Menu that usually remains visible and is usually presented horizontally.

§

MenuItem

An option in a set of choices contained by a Role::Menu or Role::Menubar.

§

MenuItemCheckbox

A Role::MenuItem with a checkable state whose possible values are true, false, or mixed.

§

MenuItemRadio

A checkable Role::MenuItem in a set of elements with the same role, only one of which can be checked at a time.

§

Meter

An element that represents a scalar measurement within a known range, or a fractional value. See related Role::Progressbar.

§

Navigation

A Role::Landmark containing a collection of navigational elements (usually links) for navigating the document or related documents.

§

None

An element whose implicit native role semantics will not be mapped to the accessibility API. See synonym Role::Presentation.

§

Note

A Role::Section whose content represents additional information or parenthetical context to the primary content it supplements.

§

Option

An item in a Role::Listbox.

§

Paragraph

A paragraph of content.

§

Presentation

An element whose implicit native role semantics will not be mapped to the accessibility API. See synonym Role::None.

§

Progressbar

An element that displays the progress status for tasks that take a long time.

§

Radio

A checkable input in a group of elements with the same role, only one of which can be checked at a time.

§

RadioGroup

A group of Role::Radio buttons.

§

Range

An element representing a range of values.

§

Region

A Role::Landmark containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.

§

Roletype

The base role from which all other roles inherit.

§

Row

A row of cells in a tabular container.

§

RowGroup

A structure containing one or more row elements in a tabular container.

§

RowHeader

A cell containing header information for a row.

§

Scrollbar

A graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area.

§

Search

A Role::Landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility. See related Role::Form and Role::Searchbox.

§

Searchbox

A type of textbox intended for specifying search criteria. See related Role::Textbox and Role::Search.

§

Section

A renderable structural containment unit on a page.

§

SectionHead

A structure that labels or summarizes the topic of its related section.

§

Select

A form Role::Widget that allows the user to make selections from a set of choices.

§

Separator

A divider that separates and distinguishes sections of content or groups of Role::MenuItems.

§

Slider

An input where the user selects a value from within a given range.

§

SpinButton

A form of Role::Range that expects the user to select from among discrete choices.

§

Status

A type of live region whose content is advisory information for the user but is not important enough to justify an Role::Alert, often but not necessarily presented as a status bar.

§

Strong

Content that is important, serious, or urgent. See related Role::Emphasis.

§

Structure

A document structural element.

§

Subscript

One or more subscripted characters. See related Role::Superscript.

§

Suggestion

A single proposed change to content.

§

Superscript

One or more superscripted characters. See related Role::Subscript.

§

Switch

A type of checkbox that represents on/off values, as opposed to checked/unchecked values. See related Role::Checkbox.

§

Tab

A grouping label providing a mechanism for selecting the tab content that is to be rendered to the user.

§

Table

A Role::Section containing data arranged in rows and columns. See related Role::Grid.

§

TabList

A list of Role::Tab elements, which are references to Role::TabPanel elements.

§

TabPanel

A container for the resources associated with a Role::Tab, where each tab is contained in a Role::TabList.

§

Term

A word or phrase with an optional corresponding definition. See related Role::Definition.

§

Textbox

A type of input that allows free-form text as its value.

§

Time

An element that represents a specific point in time.

§

Timer

A type of live region containing a numerical counter which indicates an amount of elapsed time from a start point, or the time remaining until an end point.

§

Toolbar

A collection of commonly used function buttons or controls represented in compact visual form.

§

Tooltip

A contextual popup that displays a description for an element.

§

Tree

A Role::Widget that allows the user to select one or more items from a hierarchically organized collection.

§

TreeGrid

A grid whose rows can be expanded and collapsed in the same manner as for a Role::Tree.

§

TreeItem

An item in a Role::Tree.

§

Widget

An interactive component of a graphical user interface (GUI).

§

Window

A browser or application window.

Trait Implementations§

Source§

impl Attributes for Role

Source§

fn render(self, r: &mut ElementRenderer) -> Result<(), Error>

Source§

fn get<T: 'static>(&self) -> Option<&T>

Source§

fn get_mut<T: 'static>(&mut self) -> Option<&mut T>

Source§

fn with<A: Attributes>(self, attr: A) -> Pair<A, Self>

Source§

impl Clone for Role

Source§

fn clone(&self) -> Role

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Role

Source§

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

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

impl Display for Role

Source§

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

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

impl Hash for Role

Source§

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

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

Source§

fn cmp(&self, other: &Role) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Role

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 PartialOrd for Role

Source§

fn partial_cmp(&self, other: &Role) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Role

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 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> 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> 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
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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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