Trait maple_core::render::Render [−][src]
Trait for describing how something should be rendered into DOM nodes.
Required methods
fn render(&self) -> Node
[src]
Called during the initial render when creating the DOM nodes. Should return a Node
.
Provided methods
fn update_node(&self, parent: &Node, node: &Node) -> Node
[src]
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.
Returns the new node. If the node is reused instead of replaced, the returned node is simply the node passed in.