pub struct DynamicNode { /* private fields */ }Expand description
A closure-based dynamic node that re-renders when its dependency signals change.
Holds a raw pointer to a heap-allocated render closure that produces a fresh
VirtualNode on each evaluation. The renderer subscribes to the closure’s
signals and patches the DOM automatically.
Contains a HookContext that persists hook state (like use_signal) across
re-renders, ensuring that signal values are not reset when the render function
is called again.
Implements Copy for ergonomic use; all copies share the same underlying state.
SAFETY: The inner pointer is allocated via Box::leak and lives for the
entire program. This is safe in single-threaded WASM contexts where no
concurrent access can occur.
Implementations§
Source§impl DynamicNode
Implementation of dynamic node accessor methods.
impl DynamicNode
Implementation of dynamic node accessor methods.
Sourcepub fn render(&self) -> VirtualNode
pub fn render(&self) -> VirtualNode
Invokes the render closure and returns the produced virtual node.
§Returns
VirtualNode- The virtual node produced by the render closure.
Trait Implementations§
Source§impl Clone for DynamicNode
Copies a DynamicNode by bitwise copy of its raw pointer and hook context.
impl Clone for DynamicNode
Copies a DynamicNode by bitwise copy of its raw pointer and hook context.
A DynamicNode is just raw pointers; copying is a trivial bitwise copy.
Source§impl Debug for DynamicNode
impl Debug for DynamicNode
Source§impl Default for DynamicNode
Provides a default empty dynamic node with a no-op render function.
impl Default for DynamicNode
Provides a default empty dynamic node with a no-op render function.
Source§impl From<&DynamicNode> for usize
Implementation of From trait for converting &DynamicNode into usize address.
impl From<&DynamicNode> for usize
Implementation of From trait for converting &DynamicNode into usize address.
impl Copy for DynamicNode
Copies a DynamicNode by bitwise copy of its raw pointer and hook context.
A DynamicNode is just raw pointers; copying is a trivial bitwise copy.