pub struct Node { /* private fields */ }Expand description
A node in an accessibility tree snapshot, with navigation.
Node dereferences to NodeData, so all properties (role, name,
value, states, etc.) are accessible via field access. Navigation
methods (parent(), children(), query()) use the shared snapshot
— no platform refetch occurs.
Nodes are cheap to clone (they share the underlying snapshot via Arc).
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(snapshot: Arc<Tree>, index: u32) -> Self
pub fn new(snapshot: Arc<Tree>, index: u32) -> Self
Create a Node handle from a snapshot and an index into the snapshot.
Sourcepub fn tree(&self) -> &Arc<Tree>
pub fn tree(&self) -> &Arc<Tree>
Get the underlying snapshot (Tree) this node belongs to.
Used by provider crates for action dispatch.
Sourcepub fn node_index(&self) -> u32
pub fn node_index(&self) -> u32
Get the node’s index within its snapshot.
Used by provider crates for action dispatch.
Sourcepub fn parent(&self) -> Option<Node>
pub fn parent(&self) -> Option<Node>
Get the parent node, if any (root has no parent).
Uses the snapshot — no platform refetch.
Sourcepub fn children(&self) -> Vec<Node>
pub fn children(&self) -> Vec<Node>
Get direct children of this node.
Uses the snapshot — no platform refetch.