pub struct CoreNode {
pub id: NodeId,
pub op: Op,
pub children: Vec<NodeId>,
pub parent: Option<NodeId>,
pub hash: u64,
}Expand description
A single node in the intermediate representation graph.
Every element in a Fission UI compiles down to one or more CoreNodes. A node
carries an Op that says what it does (layout, paint, group, or declare
semantics), a list of children, and a content hash for efficient diffing.
§Fields
Nodes form a tree through children (downward links) and parent (upward link).
The hash field is a content hash of the node’s operation and children, used to
skip unchanged subtrees during reconciliation.
§Example
You rarely construct CoreNode directly – use CoreIR::add_node instead:
use fission_ir::{CoreIR, NodeId, Op, LayoutOp};
let mut ir = CoreIR::new();
let id = NodeId::explicit("box");
ir.add_node(id, Op::Layout(LayoutOp::Box {
width: Some(100.0), height: Some(50.0),
min_width: None, max_width: None,
min_height: None, max_height: None,
padding: [0.0; 4], flex_grow: 0.0, flex_shrink: 1.0,
aspect_ratio: None,
}), vec![]);Fields§
§id: NodeIdThe unique, content-addressed identity of this node.
op: OpThe operation this node performs (layout, paint, structural, or semantics).
children: Vec<NodeId>Ordered list of child node IDs. Order matters for layout and paint order.
parent: Option<NodeId>The parent of this node, or None if this is the root.
Set automatically by CoreIR::add_node.
hash: u64A content hash of this node’s operation and subtree, used for efficient
diffing between frames. A value of 0 means the hash has not been computed.