pub struct VNode { /* private fields */ }
Expand description
A reference to a template along with any context needed to hydrate it
The dynamic parts of the template are stored separately from the static parts. This allows faster diffing by skipping static parts of the template.
Implementations§
source§impl VNode
impl VNode
sourcepub fn empty() -> Result<VNode, RenderError>
pub fn empty() -> Result<VNode, RenderError>
Create a template with no nodes that will be skipped over during diffing
sourcepub fn placeholder() -> VNode
pub fn placeholder() -> VNode
Create a template with a single placeholder node
sourcepub fn new(
key: Option<String>,
template: Template,
dynamic_nodes: Box<[DynamicNode]>,
dynamic_attrs: Box<[Box<[Attribute]>]>,
) -> VNode
pub fn new( key: Option<String>, template: Template, dynamic_nodes: Box<[DynamicNode]>, dynamic_attrs: Box<[Box<[Attribute]>]>, ) -> VNode
Create a new VNode
sourcepub fn dynamic_root(&self, idx: usize) -> Option<&DynamicNode>
pub fn dynamic_root(&self, idx: usize) -> Option<&DynamicNode>
Load a dynamic root at the given index
Returns None
if the root is actually a static node (Element/Text)
sourcepub fn mounted_dynamic_node(
&self,
dynamic_node_idx: usize,
dom: &VirtualDom,
) -> Option<ElementId>
pub fn mounted_dynamic_node( &self, dynamic_node_idx: usize, dom: &VirtualDom, ) -> Option<ElementId>
Get the mounted id for a dynamic node index
sourcepub fn mounted_root(
&self,
root_idx: usize,
dom: &VirtualDom,
) -> Option<ElementId>
pub fn mounted_root( &self, root_idx: usize, dom: &VirtualDom, ) -> Option<ElementId>
Get the mounted id for a root node index
sourcepub fn mounted_dynamic_attribute(
&self,
dynamic_attribute_idx: usize,
dom: &VirtualDom,
) -> Option<ElementId>
pub fn mounted_dynamic_attribute( &self, dynamic_attribute_idx: usize, dom: &VirtualDom, ) -> Option<ElementId>
Get the mounted id for a dynamic attribute index
Trait Implementations§
source§impl IntoDynNode for &VNode
impl IntoDynNode for &VNode
source§fn into_dyn_node(self) -> DynamicNode
fn into_dyn_node(self) -> DynamicNode
Consume this item and produce a DynamicNode
source§impl IntoDynNode for VNode
impl IntoDynNode for VNode
source§fn into_dyn_node(self) -> DynamicNode
fn into_dyn_node(self) -> DynamicNode
Consume this item and produce a DynamicNode
Auto Trait Implementations§
impl !Freeze for VNode
impl !RefUnwindSafe for VNode
impl !Send for VNode
impl !Sync for VNode
impl Unpin for VNode
impl !UnwindSafe for VNode
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.