pub trait TimerMethods: TimerHandle {
    // Provided methods
    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§

source

fn start(&self) -> Result<(), StartTimerError>

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

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

source

fn stop(&self) -> Result<(), StopTimerError>

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

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

source

fn set_delay(&self, delay: Option<Duration>) -> Result<(), SetTimerDelayError>

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).

source

fn set_period( &self, period: Option<Duration> ) -> Result<(), SetTimerPeriodError>

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§