pub struct DynamicNode {
pub render_fn: Rc<RefCell<dyn FnMut() -> VirtualNode>>,
pub hook_context: HookContext,
}Expand description
A closure-based dynamic node that re-renders when its dependency signals change.
Holds a boxed 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.
Fields§
§render_fn: Rc<RefCell<dyn FnMut() -> VirtualNode>>The closure that generates the dynamic virtual node tree.
hook_context: HookContextPersistent hook context for this dynamic node, storing signal state and other hook values across render cycles.
Implements Copy; all copies share the same underlying state.
Trait Implementations§
Source§impl Clone for DynamicNode
Clones a DynamicNode by cloning its HookContext (Copy) and render_fn (Rc).
impl Clone for DynamicNode
Clones a DynamicNode by cloning its HookContext (Copy) and render_fn (Rc).
Source§fn clone(&self) -> DynamicNode
fn clone(&self) -> DynamicNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicNode
impl !RefUnwindSafe for DynamicNode
impl !Send for DynamicNode
impl !Sync for DynamicNode
impl Unpin for DynamicNode
impl UnsafeUnpin for DynamicNode
impl !UnwindSafe for DynamicNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more