pub trait AppEvents<Global, Action, Error>{
// 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§
sourcefn init(
&mut self,
ctx: &mut AppContext<'_, Global, Action, Error>,
) -> Result<(), Error>
fn init( &mut self, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<(), Error>
Initialize the application. Runs before the first repaint.
sourcefn timer(
&mut self,
event: &TimeOut,
ctx: &mut AppContext<'_, Global, Action, Error>,
) -> Result<Control<Action>, Error>
fn timer( &mut self, event: &TimeOut, ctx: &mut AppContext<'_, Global, Action, Error>, ) -> Result<Control<Action>, Error>
Timeout event.
sourcefn crossterm(
&mut self,
event: &Event,
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>
Crossterm event.
sourcefn action(
&mut self,
event: &mut Action,
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>
Run an action.
sourcefn error(
&self,
event: Error,
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>
Do error handling.