pub struct VirtualNode {
pub tag: &'static str,
pub styles: StylesList,
pub create_component_fn: fn(key: ComponentKey) -> Box<dyn Component>,
pub props: Box<dyn Any>,
pub children: Vec<RSX>,
}Expand description
A VirtualNode is akin to an Element in React terms. Here, we provide a way
for lazy Component instantiation, properties, children and so on.
Fields§
§tag: &'static strUsed in debugging/printing/etc.
styles: StylesListUsed for determining which CSS styles should be applied to this node. This property is accessed often enough that it’s separated out here.
create_component_fn: fn(key: ComponentKey) -> Box<dyn Component>Component instances are created on-demand, if the reconciler deems it be so. This
is a closure that should return an instance of the correct type.
props: Box<dyn Any>When some RSX is returned, we scoop up the props inside a special block, and then shove
them in here as an Any object. When you derive(Props) on a Component struct, it
creates a setter that specifically handles downcasting and persisting props for you.
children: Vec<RSX>Child components for this node.
Trait Implementations§
Source§impl Debug for VirtualNode
impl Debug for VirtualNode
Auto Trait Implementations§
impl Freeze for VirtualNode
impl !RefUnwindSafe for VirtualNode
impl !Send for VirtualNode
impl !Sync for VirtualNode
impl Unpin for VirtualNode
impl !UnwindSafe for VirtualNode
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