Module dom

Source
Expand description

This module provides functionalities for manipulating the actual Document Object Model in the browser

Re-exports§

pub use dispatch::Dispatch;
pub use util::document;
pub use util::history;
pub use util::now;
pub use util::performance;
pub use util::window;
pub use util::inject_style;

Modules§

dispatch
provides functionalities for commands to be executed by the system, such as when the application starts or after the application updates.
events
Create events Object
skip_diff
util
utility functions

Structs§

AnimationFrameHandle
request animation frame handle
Cmd
Cmd is a way to tell the Runtime that something needs to be executed
Document
Provides function for document related functions
DomAttr
a dom version of the Attribute, thereby removing the MSG generic
DomNode
A counter part of the vdom Node This is needed, so that we can
DomPatch
a Patch where the virtual nodes are all created in the document. This is necessary since the created Node doesn’t contain references as opposed to Patch which contains reference to the vdom, which makes it hard to be included in a struct
Effects
Effects is a convenient way to group Msg for component to execute subsequent updates based on certain conditions. This can be used for doing animation and incremental changes to the view to provide an effect of transition or animation.
GroupedDomAttrValues
a struct where the listeners, plain values, styles and function call values are grouped separately
Http
Provides functions for doing http network request
Measurements
Contains the time it took for the last app update call for the component TODO: Maybe rename to Diagnostics
MountProcedure
specify how the root node will be mounted to the mount node
Program
Program handle the lifecycle of the APP
SkipDiff
if the expression evaluates to true, diffing at this node will be skipped entirely
SkipPath
combination of TreePath and SkipDiff
StatefulModel
Wrapper for stateful component
StatelessModel
Contains necessary information for creating template of the Component of this type_id
Time
Provides function related to Time
TimeoutCallbackHandle
handle for request_idle_callback calls
Window
Provides function for window related functions

Enums§

DomAttrValue
a dom version of the Attribute value, thereby removing the MSG generic
Event
Map the Event to DomEvent, which are browser events
IdleCallbackHandle
IdleDeadline
Idle deadline interface which could be the real idle deadline if supported, otherwise the polyfill
MountAction
specify how the App is mounted to the DOM
MountTarget
specify whether to attach the Node in shadow_root
PatchVariant
patch variant

Traits§

Application
An Application is the root component of your program. Everything that happens in your application is done here.
Component
A component has a view and can update itself.
StatefulComponent
A component that can be used directly in the view without mapping

Functions§

apply_dom_patches
TODO: this should not have access to root_node, so it can generically apply patch to any dom node
component
create a stateless component node
convert_patches
get the real DOM target node and make a DomPatch object for each of the Patch
create_dom_node
Create a dom node
delay
wrapper of async delay but return no result, assume success
request_animation_frame
utility function which a closure in request animation frame
request_idle_callback
request idle callback
request_timeout_callback
request and idle callback
skip_if
skip diffing the node is the val is true
spawn_local
Runs a Rust Future on the current thread.
stateful_component
create a stateful component node