pub trait Node: Any {
Show 19 methods
// Provided methods
fn mount(&mut self) { ... }
fn update(&mut self) { ... }
fn unmount(&mut self) { ... }
fn insert_child(&mut self, _child: NodeId) { ... }
fn remove_child(&mut self, _child: NodeId) { ... }
fn move_child(&mut self, _from: usize, _to: usize) { ... }
fn update_children(&mut self, _children: &[NodeId]) { ... }
fn children(&self) -> Vec<NodeId> ⓘ { ... }
fn set_node_id(&mut self, _id: NodeId) { ... }
fn on_attached_to_parent(&mut self, _parent: NodeId) { ... }
fn on_removed_from_parent(&mut self) { ... }
fn parent(&self) -> Option<NodeId> { ... }
fn mark_needs_layout(&self) { ... }
fn needs_layout(&self) -> bool { ... }
fn mark_needs_measure(&self) { ... }
fn needs_measure(&self) -> bool { ... }
fn mark_needs_semantics(&self) { ... }
fn needs_semantics(&self) -> bool { ... }
fn set_parent_for_bubbling(&mut self, parent: NodeId) { ... }
}Provided Methods§
fn mount(&mut self)
fn update(&mut self)
fn unmount(&mut self)
fn insert_child(&mut self, _child: NodeId)
fn remove_child(&mut self, _child: NodeId)
fn move_child(&mut self, _from: usize, _to: usize)
fn update_children(&mut self, _children: &[NodeId])
fn children(&self) -> Vec<NodeId> ⓘ
Sourcefn set_node_id(&mut self, _id: NodeId)
fn set_node_id(&mut self, _id: NodeId)
Called after the node is created to record its own ID. Useful for nodes that need to store their ID for later operations.
Sourcefn on_attached_to_parent(&mut self, _parent: NodeId)
fn on_attached_to_parent(&mut self, _parent: NodeId)
Called when this node is attached to a parent. Nodes with parent tracking should set their parent reference here.
Sourcefn on_removed_from_parent(&mut self)
fn on_removed_from_parent(&mut self)
Called when this node is removed from its parent. Nodes with parent tracking should clear their parent reference here.
Sourcefn parent(&self) -> Option<NodeId>
fn parent(&self) -> Option<NodeId>
Get this node’s parent ID (for nodes that track parents). Returns None if node has no parent or doesn’t track parents.
Sourcefn mark_needs_layout(&self)
fn mark_needs_layout(&self)
Mark this node as needing layout (for nodes with dirty flags). Called during bubbling to propagate dirtiness up the tree.
Sourcefn needs_layout(&self) -> bool
fn needs_layout(&self) -> bool
Check if this node needs layout (for nodes with dirty flags).
Sourcefn mark_needs_measure(&self)
fn mark_needs_measure(&self)
Mark this node as needing measure (size may have changed). Called during bubbling when children are added/removed.
Sourcefn needs_measure(&self) -> bool
fn needs_measure(&self) -> bool
Check if this node needs measure (for nodes with dirty flags).
Sourcefn mark_needs_semantics(&self)
fn mark_needs_semantics(&self)
Mark this node as needing semantics recomputation.
Sourcefn needs_semantics(&self) -> bool
fn needs_semantics(&self) -> bool
Check if this node needs semantics recomputation.
Sourcefn set_parent_for_bubbling(&mut self, parent: NodeId)
fn set_parent_for_bubbling(&mut self, parent: NodeId)
Set parent reference for dirty flag bubbling ONLY. This is a minimal version of on_attached_to_parent that doesn’t trigger registry updates or other side effects. Used during measurement when we need to establish parent connections for bubble_measure_dirty without causing the full attachment lifecycle.
Default: delegates to on_attached_to_parent for backward compatibility.