Crate sauron::prelude::mt_dom [−]
Expand description
mt-dom is a generic virtual dom implementation which doesn’t specify the types of the data that is being processed. It’s up to the library user to specify those types
The goal of this library is to provide virtual dom diffing functionality and return a portable patches which the user can then use to apply those patches in their respective UI elements.
mt-dom is not limited to be used in html base virtual-dom implementation, but can also be use for native UI elements.
Modules
Structs
These are the plain attributes of an element
Represents an element of the virtual node
An element has a generic tag, this tag could be a static str tag, such as usage in html dom.
Example of which are div
, a
, input
, img
, etc.
Text node
Describe the path traversal of a Node starting from the root node
Enums
represents a node in a virtual dom A node could be an element which can contain one or more children of nodes. A node could also be just a text node which contains a string
A Patch encodes an operation that modifies a real DOM element or native UI element
Functions
Create an attribute
Create an attribute with namespace
create a comment node
Return the patches needed for old_node
to have the same DOM as new_node
create a virtual node with tag, attrs and children
create a virtual node with namespace, tag, attrs and children
Create an html and instruct the DOM renderer and/or DOM patcher that the operation is safe.
Create a text node element