pub trait BootFn<State, EState: Send + 'static, Message> {
// Required method
fn boot(
&self,
editor_state: EditorState<EState>,
nice_ctx: NiceGuiContext,
) -> (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§
Sourcefn boot(
&self,
editor_state: EditorState<EState>,
nice_ctx: NiceGuiContext,
) -> (State, Task<Message>)
fn boot( &self, editor_state: EditorState<EState>, nice_ctx: NiceGuiContext, ) -> (State, Task<Message>)
Initializes the Application state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".