Trait sauron::dom::Application
source · pub trait Application: Sized + 'static {
type MSG;
// Required methods
fn update(&mut self, _msg: Self::MSG) -> Cmd<Self::MSG>;
fn view(&self) -> Node<Self::MSG>;
// Provided methods
fn init(&mut self) -> Cmd<Self::MSG> { ... }
fn stylesheet() -> Vec<String> { ... }
fn style(&self) -> Vec<String> { ... }
fn measurements(&mut self, _measurements: Measurements) { ... }
}
Expand description
An Application is the root component of your program. Everything that happens in your application is done here.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn init(&mut self) -> Cmd<Self::MSG>
fn init(&mut self) -> Cmd<Self::MSG>
The application can implement this method where it can modify its initial state. This method is called right after the program is mounted into the DOM.
sourcefn stylesheet() -> Vec<String>
fn stylesheet() -> Vec<String>
The css style for the application, will be mounted automatically by the program
sourcefn style(&self) -> Vec<String>
fn style(&self) -> Vec<String>
dynamic style of an application which will be reinjected when the application style changed
sourcefn measurements(&mut self, _measurements: Measurements)
fn measurements(&mut self, _measurements: Measurements)
This is called after dispatching and updating the dom for the component This is for diagnostic and performance measurement purposes.
Warning: DO NOT use for anything else other than the intended purpose
Object Safety§
This trait is not object safe.