Struct rotor_tools::timer::Ticker [] [src]

pub struct Ticker<M: Timer> {
    // some fields omitted
}

Ticker state machine

The structure implements rotor::Machine but exposes a simpler protocol that has just one method which is called when timer expires.

The Ticker machine also ensures that there are no spurious events.

Methods

impl<T: Timer> Ticker<T>

fn new(scope: &mut Scope<T::Context>, machine: T) -> Response<Ticker<T>, Void>

Trait Implementations

impl<M: Timer> Machine for Ticker<M>

type Context = M::Context

type Seed = Void

fn create(seed: Self::Seed, _scope: &mut Scope<Self::Context>) -> Response<Self, Void>

fn ready(self, _events: EventSet, _scope: &mut Scope<Self::Context>) -> Response<Self, Self::Seed>

fn spawned(self, _scope: &mut Scope<Self::Context>) -> Response<Self, Self::Seed>

fn timeout(self, scope: &mut Scope<Self::Context>) -> Response<Self, Self::Seed>

fn wakeup(self, _scope: &mut Scope<Self::Context>) -> Response<Self, Self::Seed>

fn spawn_error(self, _scope: &mut Scope<Self::Context>, error: SpawnError<Self::Seed>) -> Response<Self, Self::Seed>