pub struct TemplateResult { /* private fields */ }
Expand description
The result of the template!
macro. Should not be used directly.
Implementations§
Source§impl TemplateResult
impl TemplateResult
Sourcepub fn new(node: Node) -> Self
pub fn new(node: Node) -> Self
Create a new TemplateResult
from a Node
.
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Create a new TemplateResult
with a blank comment node
pub fn inner_element(&self) -> Node
Trait Implementations§
Source§impl Clone for TemplateResult
impl Clone for TemplateResult
Source§fn clone(&self) -> TemplateResult
fn clone(&self) -> TemplateResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TemplateResult
impl Debug for TemplateResult
Source§impl PartialEq for TemplateResult
impl PartialEq for TemplateResult
Source§impl Render for TemplateResult
impl Render for TemplateResult
Source§fn render(&self) -> Node
fn render(&self) -> Node
Called during the initial render when creating the DOM nodes. Should return a
Node
.Source§fn update_node(&self, parent: &Node, node: &Node) -> Node
fn update_node(&self, parent: &Node, node: &Node) -> Node
Called when the node should be updated with new state.
The default implementation of this will replace the child node completely with the result of calling
render
again.
Another implementation might be better suited to some specific types.
For example, text nodes can simply replace the inner text instead of recreating a new node. Read moreimpl Eq for TemplateResult
impl StructuralPartialEq for TemplateResult
Auto Trait Implementations§
impl Freeze for TemplateResult
impl RefUnwindSafe for TemplateResult
impl !Send for TemplateResult
impl !Sync for TemplateResult
impl Unpin for TemplateResult
impl UnwindSafe for TemplateResult
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