pub struct Node {Show 21 fields
pub id: String,
pub parent_id: Option<String>,
pub role: Role,
pub name: String,
pub description: Option<String>,
pub value: Option<SemanticValueObservation>,
pub state: Option<State>,
pub extended: Option<BTreeMap<String, Value>>,
pub actions: Option<Vec<Action>>,
pub input_recipes: Option<Vec<PhysicalInputRecipe>>,
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 opaque_children: bool,
pub p: Option<Provenance>,
pub px: Option<BTreeMap<String, Provenance>>,
pub geometry: NodeGeometryObservations,
pub scroll: Option<Observation<ScrollState>>,
pub painted_region: Option<Observation<SemanticPaintedRegion>>,
}Expand description
One accessible node with evidence-qualified geometry.
Fields§
§id: StringStable identity within the session.
parent_id: Option<String>Parent node, or None for a root.
role: RoleSemantic role from the current closed set.
name: StringAccessible name; empty when the node has none.
description: Option<String>Longer description, when one exists.
value: Option<SemanticValueObservation>Current value of a value-bearing node, without collapsing secrets.
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.
input_recipes: Option<Vec<PhysicalInputRecipe>>Authoritative physical recipe executed only by Termwright devices.
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.
opaque_children: boolThis node may own children the framework cannot enumerate.
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: NodeGeometryObservationsQualified layout facts for this committed observation.
scroll: Option<Observation<ScrollState>>Production application viewport state, not terminal scrollback.
painted_region: Option<Observation<SemanticPaintedRegion>>Exact production-painted cells, distinct from layout and pointer ownership.
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_opaque_children(self) -> Self
pub fn with_opaque_children(self) -> Self
Declare that this node may own children the probe cannot enumerate.
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_geometry(self, geometry: NodeGeometryObservations) -> Self
pub fn with_geometry(self, geometry: NodeGeometryObservations) -> Self
Set evidence-qualified layout facts.
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.