pub struct AriaNode {Show 13 fields
pub role: String,
pub name: String,
pub index: Option<usize>,
pub children: Vec<AriaChild>,
pub props: HashMap<String, String>,
pub box_info: BoxInfo,
pub checked: Option<AriaChecked>,
pub disabled: Option<bool>,
pub expanded: Option<bool>,
pub level: Option<u32>,
pub pressed: Option<AriaPressed>,
pub selected: Option<bool>,
pub active: Option<bool>,
}Expand description
Represents an ARIA node in the accessibility tree Based on Playwright’s AriaNode structure
Fields§
§role: StringARIA role (e.g., “button”, “link”, “textbox”, “generic”, “iframe”, “fragment”)
name: StringAccessible name of the element
index: Option<usize>Index of the element in the interactive elements array
children: Vec<AriaChild>Child nodes (can be AriaNode or text strings)
props: HashMap<String, String>ARIA properties specific to this element (e.g., url, placeholder)
box_info: BoxInfoBox information (visibility, cursor)
checked: Option<AriaChecked>Whether element is checked (for checkboxes, radios, etc.)
disabled: Option<bool>Whether element is disabled
expanded: Option<bool>Whether element is expanded (for expandable elements)
level: Option<u32>Heading/list level
pressed: Option<AriaPressed>Whether button is pressed
selected: Option<bool>Whether element is selected
active: Option<bool>Whether element is currently active/focused
Implementations§
Source§impl AriaNode
impl AriaNode
Sourcepub fn new(role: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(role: impl Into<String>, name: impl Into<String>) -> Self
Create a new AriaNode with minimal fields
Sourcepub fn with_index(self, index: usize) -> Self
pub fn with_index(self, index: usize) -> Self
Builder: set index
Sourcepub fn with_child(self, child: AriaChild) -> Self
pub fn with_child(self, child: AriaChild) -> Self
Builder: add a child node
Sourcepub fn with_children(self, children: Vec<AriaChild>) -> Self
pub fn with_children(self, children: Vec<AriaChild>) -> Self
Builder: add multiple children
Sourcepub fn with_prop(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_prop(self, key: impl Into<String>, value: impl Into<String>) -> Self
Builder: add a property
Sourcepub fn with_checked(self, checked: bool) -> Self
pub fn with_checked(self, checked: bool) -> Self
Builder: set checked state
Sourcepub fn with_disabled(self, disabled: bool) -> Self
pub fn with_disabled(self, disabled: bool) -> Self
Builder: set disabled state
Sourcepub fn with_expanded(self, expanded: bool) -> Self
pub fn with_expanded(self, expanded: bool) -> Self
Builder: set expanded state
Sourcepub fn with_level(self, level: u32) -> Self
pub fn with_level(self, level: u32) -> Self
Builder: set level
Sourcepub fn is_interactive(&self) -> bool
pub fn is_interactive(&self) -> bool
Check if this node is interactive (has an index and is visible)
Sourcepub fn has_pointer_cursor(&self) -> bool
pub fn has_pointer_cursor(&self) -> bool
Check if this node has pointer cursor
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
Check if this is a fragment or iframe
Sourcepub fn get_text_content(&self) -> String
pub fn get_text_content(&self) -> String
Get all text content (concatenate all text children recursively)
Sourcepub fn count_nodes(&self) -> usize
pub fn count_nodes(&self) -> usize
Count total nodes in subtree
Sourcepub fn find_by_index(&self, index: usize) -> Option<&AriaNode>
pub fn find_by_index(&self, index: usize) -> Option<&AriaNode>
Find node by index (depth-first search)
Sourcepub fn find_by_index_mut(&mut self, index: usize) -> Option<&mut AriaNode>
pub fn find_by_index_mut(&mut self, index: usize) -> Option<&mut AriaNode>
Find node by index (mutable)
Sourcepub fn count_interactive(&self) -> usize
pub fn count_interactive(&self) -> usize
Count interactive elements in subtree (elements with indices)
Sourcepub fn aria_equals(&self, other: &AriaNode) -> bool
pub fn aria_equals(&self, other: &AriaNode) -> bool
Check if two nodes are equal (for diffing) Based on Playwright’s ariaNodesEqual