pub struct SemanticsUpdate {
pub nodes: Vec<(NodeId, Node)>,
pub root: NodeId,
pub focus: Option<NodeId>,
}Expand description
A collected accessibility tree produced by
RenderRoot::semantics.
nodes is the flat (NodeId, Node) map every accesskit platform adapter
consumes; root is the id of the enclosing window node (always present, even
for an empty tree); focus is the node a focused widget claimed via
SemanticsCtx::set_focused, or None when nothing in the tree is focused
(a platform adapter defaults the platform focus to root in that case).
Fields§
§nodes: Vec<(NodeId, Node)>The flat node map, root first, then each contributed node in the order it was collected (pre-order, mirroring paint).
root: NodeIdThe id of the root (window) node.
focus: Option<NodeId>The focused node, if any widget claimed focus this pass.
Implementations§
Source§impl SemanticsUpdate
impl SemanticsUpdate
Sourcepub fn focus_id(&self) -> NodeId
pub fn focus_id(&self) -> NodeId
The node a platform adapter should report as focused — the focused widget’s
node, or root when nothing in the tree is
focused.
accesskit’s TreeUpdate::focus is a non-optional NodeId: an adapter
must always name some focus target, and the window root is the
conventional fallback. This is the value a shell feeds
straight into the adapter, versus reading focus
when it needs to distinguish “root, because focused” from “root, because
nothing is focused”.