Trait sauron_core::dom::Application
source · pub trait Application<MSG>where
MSG: 'static,{
// Required methods
fn update(&mut self, _msg: MSG) -> Cmd<Self, MSG>
where Self: Sized + 'static;
fn view(&self) -> Node<MSG>;
fn style(&self) -> String;
// Provided methods
fn init(&mut self) -> Cmd<Self, MSG>
where Self: Sized + 'static { ... }
fn measurements(&self, measurements: Measurements) -> Cmd<Self, MSG>
where Self: Sized + 'static { ... }
}
Expand description
An Application is the root component of your program. Everything that happens in your application is done here.
Required Methods§
Provided Methods§
sourcefn init(&mut self) -> Cmd<Self, MSG>where
Self: Sized + 'static,
fn init(&mut self) -> Cmd<Self, MSG>where Self: Sized + 'static,
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 measurements(&self, measurements: Measurements) -> Cmd<Self, MSG>where
Self: Sized + 'static,
fn measurements(&self, measurements: Measurements) -> Cmd<Self, MSG>where Self: Sized + 'static,
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
Implementors§
impl<COMP, MSG> Application<MSG> for COMPwhere COMP: Component<MSG, ()> + 'static + CustomElement<MSG>, MSG: 'static,
Auto implementation of Application trait for Component that has no external MSG but only if that Component is intended to be a CustomElement