Trait Task

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

Source

fn on_tick(&mut self, now: Instant)

Called each time the task is ticked. Default is 1ms.

Source

fn on_event(&mut self, now: Instant, input: In)

Called when an input event is received for the task.

Source

fn on_shutdown(&mut self, now: Instant)

Gracefully shuts down the task.

Implementors§