pub struct LayoutNode {
pub id: LayoutNodeId,
pub kind: NodeKind,
pub som: Option<String>,
pub page_index: Option<u32>,
pub rect: Option<Rect>,
pub presence: PresenceIR,
pub field_kind: Option<FieldKindIR>,
pub value_hash: Option<String>,
pub overflow: OverflowState,
pub form_node_id: Option<u64>,
pub children: Vec<LayoutNode>,
}Expand description
One node in the layout tree IR.
All fields are public so that consumers can construct synthetic IRs in tests without going through a builder. Construction order does not affect serialization order — the canonical-JSON serializer always emits object keys alphabetically.
Fields§
§id: LayoutNodeIdStable, path-derived identifier (see LayoutNodeId).
kind: NodeKindCoarse kind of this node.
som: Option<String>Optional Scripting Object Model (SOM) path or name.
page_index: Option<u32>Optional page index this node was placed on, 0-based.
rect: Option<Rect>Optional layout rectangle in points (1pt = 1/72 inch).
presence: PresenceIRPresence/visibility state.
field_kind: Option<FieldKindIR>Field-specific kind tag, only meaningful when kind == Field.
value_hash: Option<String>Optional 16-hex-char prefix of a value/text hash. We never serialize the raw value to keep snapshots small and to avoid leaking PII into repository-tracked goldens.
overflow: OverflowStateOverflow/split state at IR-capture time.
form_node_id: Option<u64>Optional cross-reference to a FormNodeId.0 value, useful when
correlating IR snapshots against the original FormDOM.
children: Vec<LayoutNode>Children, in their layout order.
Implementations§
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn new(id: LayoutNodeId, kind: NodeKind) -> Self
pub fn new(id: LayoutNodeId, kind: NodeKind) -> Self
Convenience constructor for a node with default fields and a given id+kind.
Sourcepub fn push_child(&mut self, child: LayoutNode) -> usize
pub fn push_child(&mut self, child: LayoutNode) -> usize
Add a child and return its position.
The caller is responsible for using LayoutNodeId::child to derive
the child’s id; this method does not mutate the child.
Trait Implementations§
Source§impl Clone for LayoutNode
impl Clone for LayoutNode
Source§fn clone(&self) -> LayoutNode
fn clone(&self) -> LayoutNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutNode
impl Debug for LayoutNode
Source§impl Default for LayoutNode
impl Default for LayoutNode
Source§fn default() -> LayoutNode
fn default() -> LayoutNode
Source§impl PartialEq for LayoutNode
impl PartialEq for LayoutNode
Source§fn eq(&self, other: &LayoutNode) -> bool
fn eq(&self, other: &LayoutNode) -> bool
self and other values to be equal, and is used by ==.