Skip to main content

SemanticsNode

Struct SemanticsNode 

Source
pub struct SemanticsNode {
Show 15 fields pub node_id: NodeId, pub role: SemanticsRole, pub widget_role: Option<SemanticsWidgetRole>, pub actions: Vec<SemanticsAction>, pub children: Vec<SemanticsNode>, pub description: Option<String>, pub state_description: Option<String>, pub on_click_label: Option<String>, pub selected: Option<bool>, pub toggled: Option<bool>, pub enabled: bool, pub custom_actions: Vec<SemanticsCustomAction>, pub canvas_children: Vec<CanvasSemanticsNode>, pub editable_text: bool, pub text_selection: Option<TextRange>,
}
Expand description

A single node within the semantics tree.

Not Eq: a node now carries drawn-control bounds, which are floats. The tree is compared for “did anything a screen reader can see change”, and that comparison is PartialEq everywhere else on the accessibility path (AccessibilityRect, AccessibilityElement) for the same reason.

Fields§

§node_id: NodeId§role: SemanticsRole

Where this node sits in the tree (layout, text, subcomposition …).

§widget_role: Option<SemanticsWidgetRole>

What kind of control this node is, as a screen reader announces it — Compose’s Role. Separate from SemanticsNode::role because a clickable Row is structurally a layout node and semantically a button.

§actions: Vec<SemanticsAction>§children: Vec<SemanticsNode>§description: Option<String>§state_description: Option<String>§on_click_label: Option<String>§selected: Option<bool>§toggled: Option<bool>§enabled: bool§custom_actions: Vec<SemanticsCustomAction>§canvas_children: Vec<CanvasSemanticsNode>

Controls this node drew rather than laid out; their bounds are relative to this node’s own top-left. See CanvasSemanticsNode.

§editable_text: bool§text_selection: Option<TextRange>

Trait Implementations§

Source§

impl Clone for SemanticsNode

Source§

fn clone(&self) -> SemanticsNode

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 SemanticsNode

Source§

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

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

impl Default for SemanticsNode

Source§

fn default() -> Self

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

impl PartialEq for SemanticsNode

Source§

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

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.