pub struct Ticker<M: Timer> { /* private fields */ }Expand description
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.
Implementations§
Trait Implementations§
Source§impl<M: Timer> Machine for Ticker<M>
impl<M: Timer> Machine for Ticker<M>
Source§fn create(
seed: Self::Seed,
_scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Void>
fn create( seed: Self::Seed, _scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Void>
Create a machine from some data Read more
Source§fn ready(
self,
_events: EventSet,
_scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn ready( self, _events: EventSet, _scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Socket readiness notification
Source§fn spawned(
self,
_scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn spawned( self, _scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Called after spawn event Read more
Source§fn timeout(
self,
scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn timeout( self, scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Timeout happened
Source§fn wakeup(
self,
_scope: &mut Scope<'_, Self::Context>,
) -> Response<Self, Self::Seed>
fn wakeup( self, _scope: &mut Scope<'_, Self::Context>, ) -> Response<Self, Self::Seed>
Message received Read more
Source§fn spawn_error(
self,
_scope: &mut Scope<'_, Self::Context>,
error: SpawnError<Self::Seed>,
) -> Response<Self, Self::Seed>
fn spawn_error( self, _scope: &mut Scope<'_, Self::Context>, error: SpawnError<Self::Seed>, ) -> Response<Self, Self::Seed>
Called instead of spawned, if there is no slab space Read more
Auto Trait Implementations§
impl<M> Freeze for Ticker<M>where
M: Freeze,
impl<M> RefUnwindSafe for Ticker<M>where
M: RefUnwindSafe,
impl<M> Send for Ticker<M>where
M: Send,
impl<M> Sync for Ticker<M>where
M: Sync,
impl<M> Unpin for Ticker<M>where
M: Unpin,
impl<M> UnsafeUnpin for Ticker<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for Ticker<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more