pub struct SceneHandle { /* private fields */ }Expand description
Shared handle wrapping a SceneTree so reactive Effect closures can patch nodes directly.
Implementations§
Source§impl SceneHandle
Shared scene handle operations enabling surgical reactive node updates.
impl SceneHandle
Shared scene handle operations enabling surgical reactive node updates.
Sourcepub fn has_deferred_writes(&self) -> bool
pub fn has_deferred_writes(&self) -> bool
Sourcepub fn flush_deferred_writes(&self) -> usize
pub fn flush_deferred_writes(&self) -> usize
Sourcepub fn mutate<F>(&self, operation: F)
pub fn mutate<F>(&self, operation: F)
Mutates the underlying SceneTree immediately when unborrowed (zero allocations) or queues operation re-entrantly until the outer borrow unwinds.
§Arguments
&Self- Scene handle reference.F- Guaranteed-delivery scene mutation closure.
Sourcepub fn set_virtual_scroll(&self, id: NodeId, scroll_y: f32, content_height: f32)
pub fn set_virtual_scroll(&self, id: NodeId, scroll_y: f32, content_height: f32)
Updates virtualized scroll metrics (scroll_y, content_height) on id for accurate scrollbar thumbs.
§Arguments
&Self- Scene handle reference.NodeId- Target virtualized scroll container.f32- Active virtual vertical scroll offset in logical pixels.f32- Total 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(&self, transition: NodeTransition)
pub fn start_transition(&self, transition: NodeTransition)
Starts or replaces a smooth paint/transform transition on the target node.
§Arguments
&Self- Scene handle reference.NodeTransition- Transition specification to run.
Sourcepub fn mark_dirty(&self, id: NodeId, mask: u16)
pub fn mark_dirty(&self, id: NodeId, mask: u16)
Marks id dirty with mask for incremental repainting.
§Arguments
&Self- Scene handle reference.NodeId- Target node handle.u16- Dirty flag bits.
Sourcepub fn replace_children_safe(&self, parent: NodeId, new_children: Vec<NodeId>)
pub fn replace_children_safe(&self, parent: NodeId, new_children: Vec<NodeId>)
Replaces all children of parent and finalizes disposed scopes and Lifecycle hooks outside the tree borrow.
§Arguments
&Self- Scene handle reference.NodeId- Parent container node.Vec<NodeId>- Replacement ordered children.
Sourcepub fn remove_and_dispose_child(&self, parent: NodeId, child: NodeId)
pub fn remove_and_dispose_child(&self, parent: NodeId, child: NodeId)
Removes child from parent, disposes its subtree, and invokes on_unmount/on_destroy outside any scene borrow.
§Arguments
&Self- Scene handle reference.NodeId- Parent container handle.NodeId- Child subtree root handle to remove and destroy.
Sourcepub fn mutate_style<F>(&self, id: NodeId, mutator: F) -> bool
pub fn mutate_style<F>(&self, id: NodeId, mutator: F) -> bool
Sourcepub fn freeze_subtree(&self, root: NodeId)
pub fn freeze_subtree(&self, root: NodeId)
Freezes a subtree visually (Display::None), cancels its transitions, and dispatches Lifecycle::on_freeze outside any scene borrow.
§Arguments
&Self- Scene handle reference.NodeId- Subtree root handle to freeze.
Sourcepub fn freeze_subtree_animated(
&self,
root: NodeId,
exit_transition: NodeTransition,
)
pub fn freeze_subtree_animated( &self, root: NodeId, exit_transition: NodeTransition, )
Freezes a subtree immediately for lifecycle/effects while animating its visual exit to Display::None.
§Arguments
&Self- Scene handle reference.NodeId- Subtree root handle to freeze and animate out.NodeTransition- Exit transition specification (hide_on_completeis enforced).
Sourcepub fn resume_subtree(&self, root: NodeId)
pub fn resume_subtree(&self, root: NodeId)
Resumes a previously frozen subtree (Display::Flex) and dispatches Lifecycle::on_resume outside any scene borrow.
§Arguments
&Self- Scene handle reference.NodeId- Subtree root handle to resume.
Sourcepub fn activate_subtree(&self, root: NodeId)
pub fn activate_subtree(&self, root: NodeId)
Dispatches Lifecycle::on_activate across all observers in the subtree rooted at root.
§Arguments
&Self- Scene handle reference.NodeId- Subtree root handle becoming active.
Sourcepub fn update_subtree(&self, root: NodeId)
pub fn update_subtree(&self, root: NodeId)
Dispatches Lifecycle::on_update across all observers in the subtree rooted at root.
§Arguments
&Self- Scene handle reference.NodeId- Subtree root handle receiving updates.
Sourcepub fn emit_subtree_appear(&self, root: NodeId)
pub fn emit_subtree_appear(&self, root: NodeId)
Dispatches SystemEvent::Appear to all Lifecycle observers and scoped hooks owned by root’s subtree.
§Arguments
&Self- Scene handle reference.NodeId- Page or component subtree root handle becoming visible.
Sourcepub fn emit_subtree_disappear(&self, root: NodeId)
pub fn emit_subtree_disappear(&self, root: NodeId)
Dispatches SystemEvent::Disappear to all Lifecycle observers and scoped hooks owned by root’s subtree.
§Arguments
&Self- Scene handle reference.NodeId- Page or component subtree root handle ceasing to be visible.
Sourcepub fn has_active_transitions(&self) -> bool
pub fn has_active_transitions(&self) -> bool
Sourcepub fn get_selected_text(&self) -> Option<String>
pub fn get_selected_text(&self) -> Option<String>
Sourcepub fn clear_text_selection(&self)
pub fn clear_text_selection(&self)
Clears any active text selection across the retained scene.
§Arguments
&Self- Scene handle reference.