pub struct DynamicNode { /* private fields */ }Expand description
A closure-based dynamic node that re-renders when its dependency signals change.
Holds a shared reference 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.
Uses Rc<UnsafeCell<>> instead of Rc<RefCell<>> to avoid runtime borrow
checking overhead. Safety is guaranteed by the single-threaded WASM context.
The Rc provides automatic memory management — the render closure is freed
when the last reference (either in the VirtualNode tree or the signal update
callback) is dropped.
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
Source§impl DynamicNode
impl DynamicNode
pub fn new( render_fn: Rc<UnsafeCell<RenderFnInner>>, hook_context: HookContext, ) -> Self
Trait Implementations§
Source§impl Clone for DynamicNode
impl Clone for DynamicNode
Source§fn clone(&self) -> DynamicNode
fn clone(&self) -> DynamicNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more