Skip to main content

Node

Trait Node 

Source
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§

Source

fn mount(&mut self)

Source

fn update(&mut self)

Source

fn unmount(&mut self)

Source

fn insert_child(&mut self, _child: NodeId)

Source

fn remove_child(&mut self, _child: NodeId)

Source

fn move_child(&mut self, _from: usize, _to: usize)

Source

fn update_children(&mut self, _children: &[NodeId])

Source

fn children(&self) -> Vec<NodeId>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn needs_layout(&self) -> bool

Check if this node needs layout (for nodes with dirty flags).

Source

fn mark_needs_measure(&self)

Mark this node as needing measure (size may have changed). Called during bubbling when children are added/removed.

Source

fn needs_measure(&self) -> bool

Check if this node needs measure (for nodes with dirty flags).

Source

fn mark_needs_semantics(&self)

Mark this node as needing semantics recomputation.

Source

fn needs_semantics(&self) -> bool

Check if this node needs semantics recomputation.

Source

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.

Source

fn recycle_key(&self) -> Option<TypeId>

Returns a recycle pool key when this node supports shell reuse.

Source

fn recycle_pool_limit(&self) -> Option<usize>

Bounds how many recyclable shells of this node type should be retained.

Source

fn prepare_for_recycle(&mut self)

Clears live attachments before the node shell enters a recycle pool.

Source

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.

Source

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.

Source

fn debug_heap_bytes(&self) -> usize

Returns the node-owned heap retained beyond the node’s own box allocation.

Implementations§

Source§

impl dyn Node

Source

pub fn as_any_mut(&mut self) -> &mut dyn Any

Implementors§