struct
AccessNode
pub struct AccessNode {
pub role: Role,
pub name: Option<String>,
pub description: Option<String>,
pub level: Option<u8>,
pub checked: Option<bool>,
pub expanded: Option<bool>,
pub selected: Option<bool>,
pub pressed: Option<bool>,
pub value: Option<String>,
pub current: Option<String>,
pub modal: bool,
pub disabled: bool,
pub focusable: bool,
pub bounds: Option<Rect>,
pub actions: Vec<String>,
pub path: Vec<usize>,
pub children: Vec<AccessNode>,
}A node in the accessibility tree.
Fields
description
pub description: Option<String>Its accessible description (aria-describedby, aria-description).
checked
pub checked: Option<bool>Checked state (checkboxes, radios, switches); None when it has none.
pressed
pub pressed: Option<bool>Pressed state of a toggle button (aria-pressed); None when it has none.
Methods
new
pub fn new(role: Role, path: Vec<usize>) -> AccessNodeA node with role at path in the rendered tree, with no name, state or children yet.
find_by_role
pub fn find_by_role(&self, role: Role) -> Vec<&AccessNode>All descendants (including self) with role, in document order.
find
pub fn find(&self, role: Role, name: &str) -> Option<&AccessNode>The first node with role and accessible name.
to_text
pub fn to_text(&self) -> StringHuman-readable dump, one node per line (like a browser's a11y tree).