[−][src]Crate virtual_dom_rs
virtual-dom-rs provides a virtual dom implementation as well as an html!
macro
that you can use to generate a virtual dom.
The virtual dom works on both the client and server. On the client we'll render
to an HtmlElement
, and on the server we render to a String
.
Re-exports
pub extern crate web_sys; |
pub use html_macro::html; |
pub use html_macro::text; |
Modules
prelude | Exports structs and macros that you'll almost always want access to in a virtual-dom powered application |
virtual_node_test_utils | A collection of functions that are useful for unit testing your html! views. |
Structs
Closure | A handle to both a closure in Rust as well as JS closure which will invoke the Rust closure. |
Comment | The |
CreatedElement | A web_sys::Element along with all of the closures that were created for that element's events and all of it's child element's events. |
Document | The |
DomUpdater | Used for keeping a real DOM node up to date based on the current VirtualNode and a new incoming VirtualNode that represents our latest DOM state. |
Element | The |
Event | The |
EventTarget | The |
Events | We need a custom implementation of fmt::Debug since JsValue doesn't implement debug. |
HtmlCollection | The |
HtmlElement | The |
InputEvent | The |
MouseEvent | The |
Node | The |
NodeList | The |
Rc | A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'. |
RefCell | A mutable memory location with dynamically checked borrow rules |
Text | The |
VirtualNode | When building your views you'll typically use the |
Window | The |
Enums
Patch | A Patch encodes an operation that modifies a real DOM element. |
Traits
View | A trait with common functionality for rendering front-end views. |
Functions
diff | Given two VirtualNode's generate Patch's that would turn the old virtual node's real DOM node equivalent into the new VirtualNode's real DOM node equivalent. |
patch | Apply all of the patches to our old root node in order to create the new root node that we desire. This is usually used after diffing two virtual nodes. |
window | Getter for the |
Type Definitions
DynClosure | Box<dyn AsRef |