pub trait Node: Any {
Show 26 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 collect_children_into(&self, out: &mut SmallVec<[NodeId; 8]>) { ... }
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) { ... }
fn recycle_key(&self) -> Option<TypeId> { ... }
fn recycle_pool_limit(&self) -> Option<usize> { ... }
fn prepare_for_recycle(&mut self) { ... }
fn rehouse_for_recycle(&self) -> Option<Box<dyn Node>> { ... }
fn rehouse_for_live_compaction(&mut self) -> Option<Box<dyn Node>> { ... }
fn debug_heap_bytes(&self) -> usize { ... }
}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 collect_children_into(&self, out: &mut SmallVec<[NodeId; 8]>)
fn collect_children_into(&self, out: &mut SmallVec<[NodeId; 8]>)
Copies child IDs into the provided scratch buffer without allocating a fresh container for every traversal.
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.
Sourcefn recycle_key(&self) -> Option<TypeId>
fn recycle_key(&self) -> Option<TypeId>
Returns a recycle pool key when this node supports shell reuse.
Sourcefn recycle_pool_limit(&self) -> Option<usize>
fn recycle_pool_limit(&self) -> Option<usize>
Bounds how many recyclable shells of this node type should be retained.
Sourcefn prepare_for_recycle(&mut self)
fn prepare_for_recycle(&mut self)
Clears live attachments before the node shell enters a recycle pool.
Sourcefn rehouse_for_recycle(&self) -> Option<Box<dyn Node>>
fn rehouse_for_recycle(&self) -> Option<Box<dyn Node>>
Optionally provides a compact replacement box for this recycled shell.
Returning Some lets nodes move pooled survivors onto fresh compact
storage so the recycle pool does not pin large spike-era allocations.
Sourcefn rehouse_for_live_compaction(&mut self) -> Option<Box<dyn Node>>
fn rehouse_for_live_compaction(&mut self) -> Option<Box<dyn Node>>
Optionally moves a live node onto a fresh box during applier compaction.
This is used after large-majority teardowns where a small surviving live tree can otherwise pin allocator pages from a much larger spike-era node population. Implementations must preserve the node’s live state.
Sourcefn debug_heap_bytes(&self) -> usize
fn debug_heap_bytes(&self) -> usize
Returns the node-owned heap retained beyond the node’s own box allocation.