pub struct Node {Show 19 fields
pub id: String,
pub parent_id: Option<String>,
pub role: Role,
pub name: String,
pub description: Option<String>,
pub value: Option<String>,
pub bounds: Option<Rect>,
pub state: Option<State>,
pub extended: Option<BTreeMap<String, Value>>,
pub actions: Option<Vec<Action>>,
pub labelled_by: Option<Vec<String>>,
pub described_by: Option<Vec<String>>,
pub text_ranges: Option<Vec<TextRange>>,
pub test_id: Option<String>,
pub framework_type: Option<String>,
pub occlusion: Option<Occlusion>,
pub p: Option<Provenance>,
pub px: Option<BTreeMap<String, Provenance>>,
pub geometry: Option<NodeGeometryObservations>,
}Expand description
One accessible node. bounds, when present, are absolute viewport cells.
Fields§
§id: StringStable identity within the session.
parent_id: Option<String>Parent node, or None for a root.
role: RoleSemantic role from the closed v1 set.
name: StringAccessible name; empty when the node has none.
description: Option<String>Longer description, when one exists.
value: Option<String>Current value of a value-bearing node.
bounds: Option<Rect>Absolute viewport cells, when the node is painted.
state: Option<State>Asserted state flags; unset members are not claims.
extended: Option<BTreeMap<String, Value>>Application-defined JSON state, separate from portable state flags.
actions: Option<Vec<Action>>Capability hints, never callback endpoints.
labelled_by: Option<Vec<String>>Ids of nodes that name this one.
described_by: Option<Vec<String>>Ids of nodes that describe this one.
text_ranges: Option<Vec<TextRange>>Offset-to-cell mapping for this node’s text.
test_id: Option<String>Author-supplied test id.
framework_type: Option<String>What the UI framework calls this widget. Required when role is
Role::Generic: an unrecognised widget must at least name its own
type, so a reader can tell one unknown thing from another.
occlusion: Option<Occlusion>Whether the producer can say if these cells are covered by something
painted later. Only a producer that observes paint order may say
Known; the driver refuses pointer actions on anything else.
p: Option<Provenance>Where this node’s facts came from, as a whole.
px: Option<BTreeMap<String, Provenance>>Where individual fields came from, when they differ from p.
geometry: Option<NodeGeometryObservations>Protocol v2 qualified layout facts; omitted by strict v1 snapshots.
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(id: impl Into<String>, role: Role, name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, role: Role, name: impl Into<String>) -> Self
A node with only the required fields set.
Sourcepub fn with_framework_type(self, framework_type: impl Into<String>) -> Self
pub fn with_framework_type(self, framework_type: impl Into<String>) -> Self
Name what the framework calls this widget, which the protocol requires
for a Role::Generic node.
Sourcepub fn with_parent(self, parent_id: impl Into<String>) -> Self
pub fn with_parent(self, parent_id: impl Into<String>) -> Self
Attach this node to a parent.
Sourcepub fn with_bounds(self, bounds: Rect) -> Self
pub fn with_bounds(self, bounds: Rect) -> Self
Set absolute viewport bounds.
Sourcepub fn with_state(self, state: State) -> Self
pub fn with_state(self, state: State) -> Self
Set the state flags, dropping them when nothing is asserted.
Sourcepub fn with_extended(self, extended: BTreeMap<String, Value>) -> Self
pub fn with_extended(self, extended: BTreeMap<String, Value>) -> Self
Attach application-defined JSON state.
Sourcepub fn with_actions(self, actions: Vec<Action>) -> Self
pub fn with_actions(self, actions: Vec<Action>) -> Self
Declare which actions the node supports.
Sourcepub fn with_test_id(self, test_id: impl Into<String>) -> Self
pub fn with_test_id(self, test_id: impl Into<String>) -> Self
Set the author-supplied test id.