Skip to main content

Module role

Module role 

Source
Expand description

Roles: the runtime Role enum, one zero-sized marker type per role, and the sealed capability traits that say what each role can do.

Code written by people names a role through its marker type, such as Button or CheckBox, so a method gated on a capability only compiles for roles that have it. Trees, YAML, selector strings and the wire carry the runtime Role instead.

Everything here comes from one table, so the enum, the marker types, the capability impls and the names cannot drift apart.

Structs§

Alert
The role type for Role::Alert, selector name alert.
AlertDialog
The role type for Role::AlertDialog, selector name alertdialog.
AnyRole
The role of a node found by text, test id or a run-time selector.
Button
The role type for Role::Button, selector name button.
Canvas
The role type for Role::Canvas, selector name canvas.
Capabilities
The run-time mirror of the capability traits, for the recorder, the remote client and audits.
Cell
The role type for Role::Cell, selector name cell.
CheckBox
The role type for Role::CheckBox, selector name checkbox.
ColumnHeader
The role type for Role::ColumnHeader, selector name columnheader.
ComboBox
The role type for Role::ComboBox, selector name combobox.
Dialog
The role type for Role::Dialog, selector name dialog.
Document
The role type for Role::Document, selector name document.
Generic
The role type for Role::Generic, selector name generic.
Grid
The role type for Role::Grid, selector name grid.
Group
The role type for Role::Group, selector name group.
Heading
The role type for Role::Heading, selector name heading.
Image
The role type for Role::Image, selector name img.
Link
The role type for Role::Link, selector name link.
List
The role type for Role::List, selector name list.
ListBox
The role type for Role::ListBox, selector name listbox.
ListItem
The role type for Role::ListItem, selector name listitem.
ListOption
The role type for Role::ListOption, selector name option.
Menu
The role type for Role::Menu, selector name menu.
MenuBar
The role type for Role::MenuBar, selector name menubar.
MenuItem
The role type for Role::MenuItem, selector name menuitem.
MenuItemCheckBox
The role type for Role::MenuItemCheckBox, selector name menuitemcheckbox.
MenuItemRadio
The role type for Role::MenuItemRadio, selector name menuitemradio.
Navigation
The role type for Role::Navigation, selector name navigation.
Paragraph
The role type for Role::Paragraph, selector name paragraph.
ParseRoleError
A string that names no role.
PasswordInput
The role type for Role::PasswordInput, selector name password.
ProgressIndicator
The role type for Role::ProgressIndicator, selector name progressbar.
RadioButton
The role type for Role::RadioButton, selector name radio.
RadioGroup
The role type for Role::RadioGroup, selector name radiogroup.
Region
The role type for Role::Region, selector name region.
RoleMismatch
A role type was asked for a Role it does not stand for.
Row
The role type for Role::Row, selector name row.
RowHeader
The role type for Role::RowHeader, selector name rowheader.
Scrim
The role type for Role::Scrim, selector name scrim.
ScrollView
The role type for Role::ScrollView, selector name scrollview.
SearchBox
The role type for Role::SearchBox, selector name searchbox.
Separator
The role type for Role::Separator, selector name separator-static.
Slider
The role type for Role::Slider, selector name slider.
SpinButton
The role type for Role::SpinButton, selector name spinbutton.
Splitter
The role type for Role::Splitter, selector name separator.
Status
The role type for Role::Status, selector name status.
Switch
The role type for Role::Switch, selector name switch.
Tab
The role type for Role::Tab, selector name tab.
TabList
The role type for Role::TabList, selector name tablist.
TabPanel
The role type for Role::TabPanel, selector name tabpanel.
Table
The role type for Role::Table, selector name table.
Text
The role type for Role::Text, selector name text.
TextBox
The role type for Role::TextBox, selector name textbox.
ToggleButton
The role type for Role::ToggleButton, selector name togglebutton.
Toolbar
The role type for Role::Toolbar, selector name toolbar.
Tooltip
The role type for Role::Tooltip, selector name tooltip.
Tree
The role type for Role::Tree, selector name tree.
TreeItem
The role type for Role::TreeItem, selector name treeitem.
Unknown
The role type for Role::Unknown, selector name unknown.
Window
The role type for Role::Window, selector name window.

Enums§

Role
The runtime role of a node, carried by trees, YAML, selector strings and the wire.

Traits§

Checkable
Roles that have a checked state: check, uncheck, set_checked, to_be_checked.
Editable
Roles whose text can be typed into: fill, clear, press_sequentially, to_be_editable.
Expandable
Roles that open and close: expand, collapse, to_be_expanded.
HasValue
Roles that have a value to read: to_have_value.
Leveled
Roles with a nesting level: to_have_level.
Pressable
Toggle buttons, which report whether they are pressed: to_be_pressed.
RangeValue
Roles with a numeric value in a range: set_value.
RoleKind
The one marker trait every role type and AnyRole implement. Sealed.
RoleType
Implemented by concrete roles only, never by AnyRole. Sealed through RoleKind.
Selectable
Roles that own a set of options to pick from: select_option.
SelectableItem
Items inside a list, tree, table or tab list that can be selected: select, to_be_selected.
Untyped
Implemented by AnyRole only. Gates narrowing an untyped handle to a role.