pub struct TreeNode {Show 22 fields
pub id: NodeId,
pub view_id: ViewId,
pub kind: ViewKind,
pub modifier: Modifier,
pub semantics: Option<Semantics>,
pub children: SmallVec<[NodeId; 4]>,
pub parent: Option<NodeId>,
pub content_hash: u64,
pub layout_hash: u64,
pub measurement_hash: u64,
pub paint_hash: u64,
pub semantics_hash: u64,
pub subtree_hash: u64,
pub layout_subtree_hash: u64,
pub measurement_subtree_hash: u64,
pub paint_subtree_hash: u64,
pub semantics_subtree_hash: u64,
pub layout_cache: Option<LayoutCache>,
pub generation: u64,
pub user_key: Option<u64>,
pub depth: u32,
pub scope_key: Option<String>,
}Expand description
A node in the persistent view tree.
Fields§
§id: NodeIdInternal slotmap key.
view_id: ViewIdUser-facing stable view ID (for hit testing, focus, etc.).
kind: ViewKindThe kind of view this node represents.
modifier: ModifierLayout and styling modifiers.
semantics: Option<Semantics>§children: SmallVec<[NodeId; 4]>Child node IDs.
parent: Option<NodeId>Parent node ID (None for root).
content_hash: u64Legacy aggregate hash of this node’s immediate content.
layout_hash: u64Hash of values that can change layout.
measurement_hash: u64Hash of values that can change text or intrinsic measurement.
paint_hash: u64Hash of values that can change painting.
semantics_hash: u64Hash of accessibility semantics.
subtree_hash: u64Legacy aggregate hash including all descendants.
layout_subtree_hash: u64§measurement_subtree_hash: u64§paint_subtree_hash: u64§semantics_subtree_hash: u64§layout_cache: Option<LayoutCache>Cached layout result.
generation: u64Generation when this node was last updated.
user_key: Option<u64>Key provided by user for stable identity in dynamic lists.
depth: u32Depth in tree (root = 0).
scope_key: Option<String>If this node is a scope boundary (set by scope! macro), this holds the
scope key (e.g., “title”, “color_buttons”). None for non-scope nodes.
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn new(
id: NodeId,
view_id: ViewId,
kind: ViewKind,
modifier: Modifier,
generation: u64,
) -> Self
pub fn new( id: NodeId, view_id: ViewId, kind: ViewKind, modifier: Modifier, generation: u64, ) -> Self
Create a new tree node.
Sourcepub fn has_valid_layout(&self) -> bool
pub fn has_valid_layout(&self) -> bool
Check if this node’s layout cache is still valid.
Sourcepub fn invalidate_layout(&mut self)
pub fn invalidate_layout(&mut self)
Invalidate layout cache (called when content changes).
Sourcepub fn cached_rect(&self) -> Option<Rect>
pub fn cached_rect(&self) -> Option<Rect>
Get cached layout if available.