Module sauron_core::dom
source · Expand description
This module provides functionalities for manipulating the actual Document Object Model in the browser
Re-exports
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;
pub use cmd::Cmd;
Modules
- provides functionalities for commands to be executed by the system, such as when the application starts or after the application updates.
- Create events Object
- utility functions
Structs
- request animation frame handle
- A generic wrapper for a closure in rust where we can transform and pass around.
- 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 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.
- Provides functions for doing http network request
- Contains the time it took for the last app update call for the component TODO: Maybe rename to Diagnostics
- These are collections of fields where we can modify the Cmd such as logging measurement or should update the view
- Program handle the lifecycle of the APP
- Task is used to do asynchronous operations
- handle for request_idle_callback calls
- A self contain web component This is needed to move some of the code from the #custom_element macro This is also necessary, since #[wasm_bindgen] macro can not process impl types which uses generics, we use generics here to simplify the code and do the type checks for us, rather than in the code derived from the #[web_component] macro
Enums
- Map the Event to DomEvent, which are browser events
- Idle deadline interface which could be the real idle deadline if supported, otherwise the polyfill
- specify how the App is mounted to the DOM
- specify whether to attach the Node in shadow_root
- patch variant
Traits
- An Application is the root component of your program. Everything that happens in your application is done here.
- A component has a view and can update itself.
- A Container have children that is set from the parent component
- a trait for implementing WebComponent in the DOM with custom tag
- A widget is a very simple component that can update itself view, but it can have no effect on the external component that use it.
Functions
- wrapper of async delay but return no result, assume success
- utility function which a closure in request animation frame
- request idle callback
- request and idle callback
- Runs a Rust
Future
on the current thread.