Skip to main content

SemanticsRole

Enum SemanticsRole 

Source
pub enum SemanticsRole {
Show 30 variants Button, CheckBox, Slider, TextInput, TextRun, Label, Image, Container, Unknown, Dialog, Tab, TabList, TabPanel, List, ListItem, ListOption, Grid, GridRow, GridCell, Tree, TreeItem, Progress, Toast, Menu, MenuItem, ComboBox, RadioGroup, RadioButton, Tooltip, Splitter,
}
Expand description

语义角色 — 描述 Widget 在无障碍树中扮演什么

这是 mgui 自己的中间表示,避免 core crate 依赖 accesskit。 runtime crate 负责把它翻译成 accesskit::Role。

Variants§

§

Button

普通按钮(可聚焦 + 可 Click)

§

CheckBox

复选框(可聚焦 + 可 Toggle)

§

Slider

滑块(可聚焦 + 可 SetValue [0,1])

§

TextInput

单行文本输入(可聚焦 + 可 SetValue)

§

TextRun

文本运行(TextInput 的虚拟子节点;支持 SetTextSelection)

§

Label

纯文本标签(只读,通常不可聚焦)

§

Image

静态图片

§

Container

容器 — 聚合子节点的语义父节点

§

Unknown

未知/无意义 — 纯视觉装饰层,从无障碍树中隐藏

§

Dialog

模态/非模态对话框

§

Tab

页签

§

TabList

页签条容器

§

TabPanel

页签内容面板

§

List

列表容器

§

ListItem

列表项

§

ListOption

下拉/组合框选项

§

Grid

表格/网格

§

GridRow

表格行(虚拟子项用)

§

GridCell

表格单元格(虚拟子项用)

§

Tree

树

§

TreeItem

树节点

§

Progress

进度指示器

§

Toast

Toast / 通知(配合 live region)

§

Menu

弹出菜单容器

§

MenuItem

菜单项(可 Click)

§

ComboBox

下拉组合框(可 Click / 展开)

§

RadioGroup

单选组容器

§

RadioButton

单选按钮(可 Click)

§

Tooltip

工具提示气泡

§

Splitter

可拖动分隔条

Trait Implementations§

Source§

impl Clone for SemanticsRole

Source§

fn clone(&self) -> Self

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 SemanticsRole

Source§

impl Debug for SemanticsRole

Source§

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

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

impl Eq for SemanticsRole

Source§

impl PartialEq for SemanticsRole

Source§

fn eq(&self, other: &Self) -> 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 SemanticsRole

Auto Trait Implementations§

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.