pub trait Task<In, Out>: TaskSwitcherChild<Out> {
// Required methods
fn on_tick(&mut self, now: Instant);
fn on_event(&mut self, now: Instant, input: In);
fn on_shutdown(&mut self, now: Instant);
}Expand description
Represents a task.
Required Methods§
Sourcefn on_event(&mut self, now: Instant, input: In)
fn on_event(&mut self, now: Instant, input: In)
Called when an input event is received for the task.
Sourcefn on_shutdown(&mut self, now: Instant)
fn on_shutdown(&mut self, now: Instant)
Gracefully shuts down the task.