Enum Role
#[repr(u8)]pub enum Role {
Show 39 variants
Unknown = 0,
Window = 1,
Application = 2,
Button = 3,
CheckBox = 4,
RadioButton = 5,
TextField = 6,
TextArea = 7,
StaticText = 8,
ComboBox = 9,
List = 10,
ListItem = 11,
Menu = 12,
MenuItem = 13,
MenuBar = 14,
Tab = 15,
TabGroup = 16,
Table = 17,
TableRow = 18,
TableCell = 19,
Toolbar = 20,
ScrollBar = 21,
Slider = 22,
Image = 23,
Link = 24,
Group = 25,
Dialog = 26,
Alert = 27,
ProgressBar = 28,
TreeItem = 29,
WebArea = 30,
Heading = 31,
Separator = 32,
SplitGroup = 33,
Switch = 34,
SpinButton = 35,
Tooltip = 36,
Status = 37,
Navigation = 38,
}Expand description
A normalized enum covering UI element types across all platforms. Derived from ARIA roles, scoped to roles commonly surfaced by real desktop applications.
Variants§
Unknown = 0
Window = 1
Application = 2
Button = 3
CheckBox = 4
RadioButton = 5
TextField = 6
Single-line text input
TextArea = 7
Multi-line text input
StaticText = 8
Non-editable text / label
ComboBox = 9
List = 10
ListItem = 11
Menu = 12
MenuItem = 13
MenuBar = 14
Tab = 15
TabGroup = 16
Table = 17
TableRow = 18
TableCell = 19
Toolbar = 20
ScrollBar = 21
Slider = 22
Image = 23
Link = 24
Group = 25
Generic container
Dialog = 26
Alert = 27
ProgressBar = 28
TreeItem = 29
WebArea = 30
Web content area / document
Heading = 31
Separator = 32
SplitGroup = 33
Switch = 34
Toggle switch (distinct from CheckBox)
SpinButton = 35
Numeric spinner input
Tooltip = 36
Tooltip popup
Status = 37
Status bar or live region
Navigation landmark
Implementations§
§impl Role
impl Role
pub fn from_snake_case(s: &str) -> Option<Role>
pub fn from_snake_case(s: &str) -> Option<Role>
Parse a snake_case role name into a Role enum variant.
Returns None if the name doesn’t match any known role.
pub fn to_snake_case(self) -> &'static str
pub fn to_snake_case(self) -> &'static str
Convert a Role to its snake_case string representation.
Trait Implementations§
§impl<'de> Deserialize<'de> for Role
impl<'de> Deserialize<'de> for Role
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Role, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Role, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§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,
Serialize this value into the given Serde serializer. Read more
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 UnwindSafe for Role
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
Mutably borrows from an owned value. Read more