Skip to main content

SemanticsNode

Struct SemanticsNode 

Source
pub struct SemanticsNode {
Show 19 fields pub id: NodeId, pub parent: Option<NodeId>, pub role: SemanticsRole, pub bounds: Rect, pub flags: SemanticsFlags, pub test_id: Option<String>, pub active_descendant: Option<NodeId>, pub pos_in_set: Option<u32>, pub set_size: Option<u32>, pub label: Option<String>, pub value: Option<String>, pub extra: SemanticsNodeExtra, pub text_selection: Option<(u32, u32)>, pub text_composition: Option<(u32, u32)>, pub actions: SemanticsActions, pub labelled_by: Vec<NodeId>, pub described_by: Vec<NodeId>, pub controls: Vec<NodeId>, pub inline_spans: Vec<SemanticsInlineSpan>,
}

Fields§

§id: NodeId§parent: Option<NodeId>§role: SemanticsRole§bounds: Rect§flags: SemanticsFlags§test_id: Option<String>

Debug/test-only identifier for deterministic automation.

This MUST NOT be mapped into platform accessibility name/label fields by default.

§active_descendant: Option<NodeId>

When this node retains actual keyboard focus but another descendant is the current “active item” (e.g. composite widgets using aria-activedescendant), this points to that active descendant node.

§pos_in_set: Option<u32>

1-based position of this node within a logical collection (e.g. listbox/menu items).

This is used to support accessible large/virtualized collections where only a window of items is present in the semantics snapshot.

§set_size: Option<u32>

Total number of items in the logical collection that this node belongs to.

This is used to support accessible large/virtualized collections where only a window of items is present in the semantics snapshot.

§label: Option<String>

Human-readable name/label for assistive technologies.

§value: Option<String>

Value text, typically for text fields and sliders.

§extra: SemanticsNodeExtra§text_selection: Option<(u32, u32)>

Text selection in UTF-8 byte offsets within value (ADR 0071).

This is (anchor, focus) to preserve selection direction for assistive technologies.

§text_composition: Option<(u32, u32)>

IME composition range in UTF-8 byte offsets within value (ADR 0071).

This is a best-effort signal for accessibility and may be omitted by implementations that cannot represent composition distinctly.

§actions: SemanticsActions

Supported actions for assistive technologies and automation.

§labelled_by: Vec<NodeId>

Nodes which provide this node’s accessible name.

This is a portable approximation of relations such as aria-labelledby.

§described_by: Vec<NodeId>

Nodes which provide this node’s accessible description.

This is a portable approximation of relations such as aria-describedby.

§controls: Vec<NodeId>

Nodes which this node controls.

This is a portable approximation of relations such as aria-controls.

§inline_spans: Vec<SemanticsInlineSpan>

Inline semantics spans within this node’s value (v1 metadata-only surface).

Implementations§

Trait Implementations§

Source§

impl Clone for SemanticsNode

Source§

fn clone(&self) -> SemanticsNode

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 SemanticsNode

Source§

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

Formats the value using the given formatter. 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 = 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.