pub struct AccessibleNode {Show 22 fields
pub id: AccessibleNodeId,
pub widget_id: Option<WidgetId>,
pub name: Option<String>,
pub description: Option<String>,
pub role: AccessibleRole,
pub bounds: Rect,
pub focusable: bool,
pub focused: bool,
pub enabled: bool,
pub visible: bool,
pub expanded: Option<bool>,
pub checked: Option<CheckedState>,
pub value: Option<String>,
pub value_min: Option<f64>,
pub value_max: Option<f64>,
pub value_text: Option<String>,
pub children: Vec<AccessibleNodeId>,
pub parent: Option<AccessibleNodeId>,
pub tab_index: i32,
pub level: Option<u8>,
pub live: LiveRegion,
pub properties: HashMap<String, String>,
}Expand description
An accessible element in the accessibility tree.
Fields§
§id: AccessibleNodeIdUnique identifier.
widget_id: Option<WidgetId>Widget ID if associated with a widget.
name: Option<String>Accessible name (label).
description: Option<String>Accessible description.
role: AccessibleRoleAccessible role.
bounds: RectBounding rectangle.
focusable: boolWhether the element is focusable.
focused: boolWhether the element is currently focused.
enabled: boolWhether the element is enabled.
visible: boolWhether the element is visible.
expanded: Option<bool>Whether the element is expanded (for expandable elements).
checked: Option<CheckedState>Whether the element is checked (for checkboxes/radios).
value: Option<String>Current value (for sliders, inputs).
value_min: Option<f64>Minimum value (for sliders).
value_max: Option<f64>Maximum value (for sliders).
value_text: Option<String>Value text (human-readable value).
children: Vec<AccessibleNodeId>Children node IDs.
parent: Option<AccessibleNodeId>Parent node ID.
tab_index: i32Tab index for focus order (-1 = not focusable, 0 = natural order, >0 = explicit order).
level: Option<u8>Level in heading hierarchy (1-6 for headings).
live: LiveRegionLive region type for dynamic content.
properties: HashMap<String, String>Custom properties.
Implementations§
Source§impl AccessibleNode
impl AccessibleNode
Sourcepub fn new(id: AccessibleNodeId, role: AccessibleRole, bounds: Rect) -> Self
pub fn new(id: AccessibleNodeId, role: AccessibleRole, bounds: Rect) -> Self
Create a new accessible node.
Create a new button node.
Sourcepub fn checkbox(
id: AccessibleNodeId,
name: &str,
checked: bool,
bounds: Rect,
) -> Self
pub fn checkbox( id: AccessibleNodeId, name: &str, checked: bool, bounds: Rect, ) -> Self
Create a new checkbox node.
Sourcepub fn text_input(
id: AccessibleNodeId,
label: &str,
value: &str,
bounds: Rect,
) -> Self
pub fn text_input( id: AccessibleNodeId, label: &str, value: &str, bounds: Rect, ) -> Self
Create a new text input node.
Sourcepub fn heading(
id: AccessibleNodeId,
text: &str,
level: u8,
bounds: Rect,
) -> Self
pub fn heading( id: AccessibleNodeId, text: &str, level: u8, bounds: Rect, ) -> Self
Create a new heading node.
Sourcepub fn slider(
id: AccessibleNodeId,
name: &str,
value: f64,
min: f64,
max: f64,
bounds: Rect,
) -> Self
pub fn slider( id: AccessibleNodeId, name: &str, value: f64, min: f64, max: f64, bounds: Rect, ) -> Self
Create a new slider node.
Sourcepub fn contains_point(&self, point: Point) -> bool
pub fn contains_point(&self, point: Point) -> bool
Check if this node contains the given point.
Sourcepub fn with_description(self, desc: &str) -> Self
pub fn with_description(self, desc: &str) -> Self
Set the node’s description.
Sourcepub fn with_focusable(self, focusable: bool) -> Self
pub fn with_focusable(self, focusable: bool) -> Self
Set the node as focusable.
Sourcepub fn with_property(self, key: &str, value: &str) -> Self
pub fn with_property(self, key: &str, value: &str) -> Self
Set a custom property.
Trait Implementations§
Source§impl Clone for AccessibleNode
impl Clone for AccessibleNode
Source§fn clone(&self) -> AccessibleNode
fn clone(&self) -> AccessibleNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AccessibleNode
impl RefUnwindSafe for AccessibleNode
impl Send for AccessibleNode
impl Sync for AccessibleNode
impl Unpin for AccessibleNode
impl UnwindSafe for AccessibleNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more