Skip to main content

SceneHandle

Struct SceneHandle 

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

Source

pub fn new_tree() -> Self

Creates a new SceneHandle wrapping a fresh SceneTree.

§Returns
  • Self - Shared scene handle.
Source

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

pub fn node_screen_bounds(&self, id: NodeId) -> Option<Rect>

Computes screen-space logical bounds for id subtracting ancestor scroll offsets.

§Arguments
  • &Self - Scene handle reference.
  • NodeId - Target node handle.
§Returns
  • Option<Rect> - Screen-space bounds if the node is alive.
Source

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

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

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

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

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

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_complete is enforced).
Source

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

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

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

pub fn has_active_transitions(&self) -> bool

Returns true if any node transition is currently active.

§Arguments
  • &Self - Scene handle reference.
§Returns
  • bool - Whether animations are running.
Source

pub fn with_read<F, R>(&self, operation: F, fallback: R) -> R
where F: FnOnce(&SceneTree) -> R,

Executes operation with immutable access to the underlying SceneTree.

§Arguments
  • &Self - Scene handle.
  • F - Reader closure.
  • R - Fallback if re-entrantly borrowed.
§Returns
  • R - Closure result or fallback.
Source

pub fn with_write<F, R>(&self, operation: F, fallback: R) -> R
where F: FnOnce(&mut SceneTree) -> R,

Executes operation with mutable access to the underlying SceneTree.

§Arguments
  • &Self - Scene handle.
  • F - Mutation closure.
  • R - Fallback if re-entrantly borrowed.
§Returns
  • R - Closure result or fallback.
Source

pub fn bind_text<F>(&self, node_id: NodeId, producer: F) -> Effect
where F: FnMut() -> String + 'static,

Binds a reactive text expression to node_id via a surgical Effect.

§Arguments
  • &Self - Scene handle.
  • NodeId - Target text node.
  • F - Reactive text producer closure.
§Returns
  • Effect - Registered reactive effect.
Source

pub fn bind_style<F>(&self, node_id: NodeId, producer: F) -> Effect
where F: FnMut() -> Style + 'static,

Binds a reactive Style expression to node_id via a surgical Effect.

§Arguments
  • &Self - Scene handle.
  • NodeId - Target node.
  • F - Reactive style producer closure.
§Returns
  • Effect - Registered reactive effect.

Trait Implementations§

Source§

impl Clone for SceneHandle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut ::std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • ::std::fmt::Result - Success or failure of the formatting operation.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.