Trait r3_core::kernel::timer::TimerMethods
source · 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§
sourcefn start(&self) -> Result<(), StartTimerError>
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.
sourcefn stop(&self) -> Result<(), StopTimerError>
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.
sourcefn set_delay(&self, delay: Option<Duration>) -> Result<(), SetTimerDelayError>
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).
sourcefn set_period(
&self,
period: Option<Duration>
) -> Result<(), SetTimerPeriodError>
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.