logo
pub trait TimerMethods: TimerHandle {
    fn start(&self) -> Result<(), StartTimerError> { ... }
fn stop(&self) -> Result<(), StopTimerError> { ... }
fn set_delay(
        &self,
        delay: Option<Duration>
    ) -> Result<(), SetTimerDelayError> { ... }
fn set_period(
        &self,
        period: Option<Duration>
    ) -> Result<(), SetTimerPeriodError> { ... } }
Expand description

The supported operations on TimerHandle.

Provided methods

Start the timer (transition it into the Active state).

This method has no effect if the timer is already in the Active state.

Stop the timer (transition it into the Dormant state).

This method has no effect if the timer is already in the Dormant state.

Set the duration before the next tick.

If the timer is currently in the Dormant state, this method specifies the duration between the next activation and the first tick following the activation.

None means infinity (the timer will never fire).

Set the timer period, which is a quantity to be added to the timer’s absolute arrival time on every tick.

None means infinity.

Implementors