Trait Boot

Source
pub trait Boot<State, Message> {
    // Required method
    fn boot(&self) -> (State, Task<Message>);
}
Expand description

The logic to initialize the State of some Application.

This trait is implemented for both Fn() -> State and Fn() -> (State, Task<Message>).

In practice, this means that application can both take simple functions like State::default and more advanced ones that return a Task.

Required Methods§

Source

fn boot(&self) -> (State, Task<Message>)

Initializes the Application state.

Implementors§

Source§

impl<T, C, State, Message> Boot<State, Message> for T
where T: Fn() -> C, C: IntoBoot<State, Message>,