pub struct Template { /* private fields */ }Expand description
A static layout of a UI tree that describes a set of dynamic and static nodes.
This is the core innovation in Dioxus. Most UIs are made of static nodes, yet participate in diffing like any dynamic node. This struct can be created at compile time. It promises that its pointer is unique, allow Dioxus to use its static description of the UI to skip immediately to the dynamic nodes during diffing.
Implementations§
Source§impl Template
impl Template
Sourcepub const fn new(
roots: &'static [TemplateNode],
node_paths: &'static [&'static [u8]],
attr_paths: &'static [&'static [u8]],
) -> Self
pub const fn new( roots: &'static [TemplateNode], node_paths: &'static [&'static [u8]], attr_paths: &'static [&'static [u8]], ) -> Self
Create a new Template with the given roots, node_paths, and attr_paths. The hash is computed automatically from the template content.
Sourcepub const fn roots(&self) -> &'static [TemplateNode]
pub const fn roots(&self) -> &'static [TemplateNode]
Get the template nodes that make up this template.
Sourcepub const fn node_paths(&self) -> &'static [&'static [u8]]
pub const fn node_paths(&self) -> &'static [&'static [u8]]
Get the paths of each dynamic node relative to the root of the template.
Sourcepub const fn attr_paths(&self) -> &'static [&'static [u8]]
pub const fn attr_paths(&self) -> &'static [&'static [u8]]
Get the paths of each dynamic attribute relative to the root of the template.
Trait Implementations§
Source§impl Ord for Template
impl Ord for Template
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Template
impl PartialOrd for Template
impl Copy for Template
impl Eq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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§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.