Trait sauron::Application [−][src]
pub trait Application<MSG> where
MSG: 'static, {
fn update(&mut self, _msg: MSG) -> Cmd<Program<Self, MSG>>
where
Self: 'static;
fn view(
&self
) -> Node<&'static str, &'static str, &'static str, AttributeValue<MSG>>;
fn init(&mut self, _program: Program<Self, MSG>) -> Cmd<Program<Self, MSG>>
where
Self: 'static,
{ ... }
fn style(&self) -> Vec<String, Global>ⓘ { ... }
fn measurements(
&self,
measurements: Measurements
) -> Cmd<Program<Self, MSG>>
where
Self: 'static,
{ ... }
}
Expand description
The app should implement this trait for it to be handled by the Program
Required methods
Called each time an action is triggered from the view
Provided methods
The application can implement this method where it can modify its initial state. It also has access to the program which is the executor of the lifecycle of the program.
this method is called right after the program is mounted into the DOM.
optionally a component can specify it’s own css style
fn measurements(&self, measurements: Measurements) -> Cmd<Program<Self, MSG>> where
Self: 'static,
fn measurements(&self, measurements: Measurements) -> Cmd<Program<Self, MSG>> where
Self: 'static,
This is called after dispatching and updating the dom for the component