Skip to main content

tree_needs_layout

Function tree_needs_layout 

Source
pub fn tree_needs_layout(
    applier: &mut dyn Applier,
    root: NodeId,
) -> Result<bool, NodeError>
Expand description

Check if a node or any of its descendants needs measure (selective measure optimization). This can be used by the app shell to skip layout when the tree is clean.

O(1) check - just looks at root’s dirty flag. Works because all mutation paths bubble dirty flags to root via composer commands.

Returns Result to force caller to handle errors explicitly. No more unwrap_or(true) safety net.