pub struct SceneTree { /* private fields */ }Expand description
Flat generation-indexed arena holding the entire retained UI scene graph.
Implementations§
Source§impl SceneTree
Core retained scene graph mutation and traversal operations.
impl SceneTree
Core retained scene graph mutation and traversal operations.
Sourcepub fn set_backdrop_blur(&mut self, id: NodeId, blur_radius: f32)
pub fn set_backdrop_blur(&mut self, id: NodeId, blur_radius: f32)
Registers or removes a backdrop-blur effect radius on id for effect-dependency damage propagation and paint emission.
§Arguments
&Self- Mutable scene tree.NodeId- Target scene node handle.f32- Gaussian backdrop blur radius in logical pixels (<= 0.0removes backdrop blur).
Sourcepub fn backdrop_blur_radius(&self, id: NodeId) -> f32
pub fn backdrop_blur_radius(&self, id: NodeId) -> f32
Sourcepub fn has_backdrop_blur_nodes(&self) -> bool
pub fn has_backdrop_blur_nodes(&self) -> bool
Sourcepub fn propagate_effect_damage(
&self,
damage: &mut DamageRegion,
scale: f32,
) -> usize
pub fn propagate_effect_damage( &self, damage: &mut DamageRegion, scale: f32, ) -> usize
Expands damage to include every visible backdrop-blur node whose sampling region intersects any damaged rect (fixpoint propagation).
§Arguments
&Self- Scene tree reference.&mut DamageRegion- Active physical damage region to expand.f32- Active display scale factor.
§Returns
usize- Number of backdrop-blur nodes added todamagedue to overlapping underlying mutations.
Sourcepub fn portal_nodes(&self) -> &[NodeId]
pub fn portal_nodes(&self) -> &[NodeId]
Sourcepub fn has_portal_nodes(&self) -> bool
pub fn has_portal_nodes(&self) -> bool
Sourcepub fn create_node(&mut self, kind: NodeKind, style: Style) -> NodeId
pub fn create_node(&mut self, kind: NodeKind, style: Style) -> NodeId
Sourcepub fn create_view(&mut self, style: Style) -> NodeId
pub fn create_view(&mut self, style: Style) -> NodeId
Sourcepub fn create_text(&mut self, content: String, style: Style) -> NodeId
pub fn create_text(&mut self, content: String, style: Style) -> NodeId
Sourcepub fn create_input(&mut self, state: InputNodeState, style: Style) -> NodeId
pub fn create_input(&mut self, state: InputNodeState, style: Style) -> NodeId
Sourcepub fn create_image(&mut self, buffer: ImageBuffer, style: Style) -> NodeId
pub fn create_image(&mut self, buffer: ImageBuffer, style: Style) -> NodeId
Sourcepub fn create_scroll_view(&mut self, style: Style) -> NodeId
pub fn create_scroll_view(&mut self, style: Style) -> NodeId
Sourcepub fn create_canvas(
&mut self,
style: Style,
painter: CanvasDrawCallback,
) -> NodeId
pub fn create_canvas( &mut self, style: Style, painter: CanvasDrawCallback, ) -> NodeId
Sourcepub fn create_portal(&mut self, style: Style) -> NodeId
pub fn create_portal(&mut self, style: Style) -> NodeId
Sourcepub fn create_fragment(&mut self) -> NodeId
pub fn create_fragment(&mut self) -> NodeId
Sourcepub fn get_node_mut(&mut self, id: NodeId) -> Option<&mut SceneNode>
pub fn get_node_mut(&mut self, id: NodeId) -> Option<&mut SceneNode>
Sourcepub fn live_node_count(&self) -> usize
pub fn live_node_count(&self) -> usize
Sourcepub fn append_child(&mut self, parent: NodeId, child: NodeId)
pub fn append_child(&mut self, parent: NodeId, child: NodeId)
Appends child to parent and marks layout and paint dirty upward.
§Arguments
&Self- Mutable scene tree.NodeId- Parent container node.NodeId- Child node to attach.
Sourcepub fn append_children(&mut self, parent: NodeId, children: &[NodeId])
pub fn append_children(&mut self, parent: NodeId, children: &[NodeId])
Appends multiple children to parent in a single dirty-marking pass with zero-alloc fresh-orphan fast path.
§Arguments
&Self- Mutable scene tree.NodeId- Parent container node.&[NodeId]- Ordered child nodes to append.
Sourcepub fn replace_children(&mut self, parent: NodeId, new_children: Vec<NodeId>)
pub fn replace_children(&mut self, parent: NodeId, new_children: Vec<NodeId>)
Replaces all children of parent with new_children, disposing previous subtrees cleanly.
§Arguments
&Self- Mutable scene tree.NodeId- Parent container node.Vec<NodeId>- Replacement ordered children.
Sourcepub fn set_style(&mut self, id: NodeId, style: Style)
pub fn set_style(&mut self, id: NodeId, style: Style)
Surgically updates a node’s Style, marking only DIRTY_PAINT for pure paint changes and skipping no-op writes.
§Arguments
&Self- Mutable scene tree.NodeId- Target node handle.Style- Replacement compiled style.
Sourcepub fn mutate_style<F>(&mut self, id: NodeId, mutator: F) -> bool
pub fn mutate_style<F>(&mut self, id: NodeId, mutator: F) -> bool
Sourcepub fn set_text(&mut self, id: NodeId, text: String)
pub fn set_text(&mut self, id: NodeId, text: String)
Surgically updates the UTF-8 string of a NodeKind::Text node.
§Arguments
&Self- Mutable scene tree.NodeId- Target text node handle.String- Replacement text string.
Sourcepub fn set_scroll_offset(&mut self, id: NodeId, offset: Point)
pub fn set_scroll_offset(&mut self, id: NodeId, offset: Point)
Updates scroll offset on a scroll container without triggering full subtree re-layout.
§Arguments
&Self- Mutable scene tree.NodeId- Target scroll container handle.Point- New scroll offset clamped to content bounds.
Sourcepub fn set_virtual_scroll(
&mut self,
id: NodeId,
scroll_y: f32,
content_height: f32,
)
pub fn set_virtual_scroll( &mut self, id: NodeId, scroll_y: f32, content_height: f32, )
Records virtualized scroll progress (scroll_y, content_height) on id for overlay scrollbar rendering.
§Arguments
&Self- Mutable scene tree.NodeId- Target virtualized scroll container.f32- Active virtual vertical scroll offset in logical pixels.f32- Full virtualized content height in logical pixels.
Sourcepub fn node_screen_bounds(&self, id: NodeId) -> Option<Rect>
pub fn node_screen_bounds(&self, id: NodeId) -> Option<Rect>
Sourcepub fn start_transition(&mut self, transition: NodeTransition)
pub fn start_transition(&mut self, transition: NodeTransition)
Starts or smoothly retargets a paint/transform transition on transition.get_node().
§Arguments
&Self- Mutable scene tree.NodeTransition- Transition specification to run.
Sourcepub fn tick_transitions(&mut self, dt_secs: f32) -> bool
pub fn tick_transitions(&mut self, dt_secs: f32) -> bool
Sourcepub fn has_active_transitions(&self) -> bool
pub fn has_active_transitions(&self) -> bool
Sourcepub fn attach_lifecycle(&mut self, id: NodeId, hook: Rc<dyn Lifecycle>)
pub fn attach_lifecycle(&mut self, id: NodeId, hook: Rc<dyn Lifecycle>)
Attaches a Lifecycle hook observer onto id for mount, activate, freeze, resume, unmount, and destroy dispatch.
§Arguments
&Self- Mutable scene tree.NodeId- Target scene node handle.Rc<dyn Lifecycle>- Shared lifecycle hook observer.
Sourcepub fn collect_subtree_scope_ids(&self, root: NodeId) -> Vec<ScopeId>
pub fn collect_subtree_scope_ids(&self, root: NodeId) -> Vec<ScopeId>
Sourcepub fn cancel_subtree_transitions(&mut self, root: NodeId)
pub fn cancel_subtree_transitions(&mut self, root: NodeId)
Cancels any active paint/transform transitions targeting nodes within the subtree rooted at root.
§Arguments
&Self- Mutable scene tree.NodeId- Subtree root handle.
Sourcepub fn attach_scope(&mut self, id: NodeId, scope: Scope)
pub fn attach_scope(&mut self, id: NodeId, scope: Scope)
Attaches a reactive Scope to id so it automatically disposes when the node unmounts.
§Arguments
&Self- Mutable scene tree.NodeId- Target node handle.Scope- Reactive ownership scope.
Sourcepub fn mark_dirty(&mut self, id: NodeId, mask: u16)
pub fn mark_dirty(&mut self, id: NodeId, mask: u16)
Marks id dirty with mask and propagates subtree dirty bits to ancestors in O(depth).
§Arguments
&Self- Mutable scene tree.NodeId- Mutated node handle.u16- Dirty flag bits to set.
Sourcepub fn is_node_visible(&self, id: NodeId) -> bool
pub fn is_node_visible(&self, id: NodeId) -> bool
Sourcepub fn collect_paint_damage(&mut self, scale: f32) -> DamageRegion
pub fn collect_paint_damage(&mut self, scale: f32) -> DamageRegion
Sourcepub fn dispose_subtree_collect(&mut self, id: NodeId) -> DisposedSubtreePayload
pub fn dispose_subtree_collect(&mut self, id: NodeId) -> DisposedSubtreePayload
Recursively detaches and recycles id, returning all owned Scopes and Lifecycle observers for borrow-safe finalization.
§Arguments
&Self- Mutable scene tree.NodeId- Subtree root handle to dispose.
§Returns
DisposedSubtreePayload- Collected scopes and lifecycle observers to finalize outside any borrow.
Sourcepub fn dispose_subtree(&mut self, id: NodeId)
pub fn dispose_subtree(&mut self, id: NodeId)
Recursively removes and disposes id, recycling all arena slots, running lifecycle hooks, and disposing scopes.
§Arguments
&Self- Mutable scene tree.NodeId- Subtree root handle to dispose.
Sourcepub fn update_focus(
&mut self,
target: Option<NodeId>,
) -> Vec<(UiEventHandler, UiEvent)>
pub fn update_focus( &mut self, target: Option<NodeId>, ) -> Vec<(UiEventHandler, UiEvent)>
Sourcepub fn is_node_selectable(&self, id: NodeId) -> bool
pub fn is_node_selectable(&self, id: NodeId) -> bool
Resolves whether id allows interactive text selection, walking ancestors unless an explicit opt-out is encountered.
§Arguments
&Self- Scene tree reference.NodeId- Target scene node handle.
§Returns
bool-truewhenidor an ancestor enablesselectablewithout an intervening explicitselectable(false).
Sourcepub fn effective_selection_color(&self, id: NodeId) -> Color
pub fn effective_selection_color(&self, id: NodeId) -> Color
Sourcepub fn text_selection(&self) -> Option<SelectionState>
pub fn text_selection(&self) -> Option<SelectionState>
Sourcepub fn set_text_selection(&mut self, selection: Option<SelectionState>)
pub fn set_text_selection(&mut self, selection: Option<SelectionState>)
Updates the active text selection state and marks affected text nodes dirty for repaint.
§Arguments
&Self- Mutable scene tree.Option<SelectionState>- Replacement selection state (Noneclears selection).
Sourcepub fn clear_text_selection(&mut self)
pub fn clear_text_selection(&mut self)
Clears any active text selection and repaints the previously selected node.
§Arguments
&Self- Mutable scene tree.