Trait rat_salsa::AppEvents

source ·
pub trait AppEvents<Global, Action, Error>
where Action: 'static + Send + Debug, Error: 'static + Send + Debug,
{ // Provided methods fn init( &mut self, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<(), Error> { ... } fn timer( &mut self, event: &TimeOut, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error> { ... } fn crossterm( &mut self, event: &Event, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error> { ... } fn action( &mut self, event: &mut Action, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error> { ... } fn error( &self, event: Error, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error> { ... } }
Expand description

Eventhandling for application level widgets.

This one collects all currently defined events. Implement this one on the state struct.

Provided Methods§

source

fn init( &mut self, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<(), Error>

Initialize the application. Runs before the first repaint.

source

fn timer( &mut self, event: &TimeOut, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error>

Timeout event.

source

fn crossterm( &mut self, event: &Event, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error>

Crossterm event.

source

fn action( &mut self, event: &mut Action, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error>

Run an action.

source

fn error( &self, event: Error, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error>

Do error handling.

Implementors§