Skip to main content

BootFn

Trait BootFn 

Source
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§

Source

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".

Implementors§

Source§

impl<T, C, State, EState: Send + 'static, Message> BootFn<State, EState, Message> for T
where T: Fn(EditorState<EState>, NiceGuiContext) -> C, C: IntoBoot<State, Message>,