Skip to main content

Semantics

Struct Semantics 

Source
pub struct Semantics {
Show 21 fields pub role: Role, pub label: Option<String>, pub focused: bool, pub enabled: bool, pub selectable_group: bool, pub checked: Option<bool>, pub selected: Option<bool>, pub value: Option<String>, pub heading: bool, pub live_region: Option<LiveRegion>, pub state_description: Option<String>, pub traversal_index: Option<f32>, pub is_traversal_group: bool, pub hidden: bool, pub collection_rows: Option<usize>, pub collection_columns: Option<usize>, pub row_index: Option<usize>, pub column_index: Option<usize>, pub progress: Option<ProgressRangeInfo>, pub error: Option<String>, pub expanded: Option<bool>,
}
Expand description

Semantics attached to a View, used to build the accessibility tree.

Fields§

§role: Role

Primary role of this node (what kind of thing it is).

§label: Option<String>

Human‑readable label for screen readers. For buttons, this is the “name” that is announced.

§focused: bool

Whether this node is currently focused.

§enabled: bool

Whether this node is actionable. Disabled nodes remain in the tree but are marked not enabled.

§selectable_group: bool

Marks this node as a collection of horizontally or vertically stacked selectable elements (ex: Tabs, RadioButtons).

§checked: Option<bool>§selected: Option<bool>§value: Option<String>§heading: bool§live_region: Option<LiveRegion>§state_description: Option<String>§traversal_index: Option<f32>§is_traversal_group: bool§hidden: bool§collection_rows: Option<usize>§collection_columns: Option<usize>§row_index: Option<usize>§column_index: Option<usize>§progress: Option<ProgressRangeInfo>§error: Option<String>§expanded: Option<bool>

Implementations§

Source§

impl Semantics

Source

pub fn new(role: Role) -> Self

Source

pub fn with_label(self, label: impl Into<String>) -> Self

Source

pub fn with_selectable_group(self) -> Self

Source

pub fn with_checked(self, checked: bool) -> Self

Source

pub fn with_selected(self, selected: bool) -> Self

Source

pub fn with_value(self, value: impl Into<String>) -> Self

Source

pub fn with_heading(self) -> Self

Source

pub fn with_live_region(self, region: LiveRegion) -> Self

Source

pub fn with_state_description(self, description: impl Into<String>) -> Self

Source

pub fn with_traversal_index(self, index: f32) -> Self

Source

pub fn with_traversal_group(self) -> Self

Source

pub fn with_hidden(self) -> Self

Source

pub fn with_collection(self, rows: usize, columns: usize) -> Self

Source

pub fn with_collection_item(self, row: usize, column: usize) -> Self

Source

pub fn with_progress_range(self, info: ProgressRangeInfo) -> Self

Source

pub fn with_error(self, message: impl Into<String>) -> Self

Source

pub fn with_expanded(self, expanded: bool) -> Self

Trait Implementations§

Source§

impl Clone for Semantics

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 Debug for Semantics

Source§

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

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

impl Default for Semantics

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.