Skip to main content

Node

Trait Node 

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

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 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.

Implementations§

Source§

impl dyn Node

Source

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

Implementors§