pub trait Alarm: Timer {
// Required methods
async fn wait_until_ticks(
&mut self,
value: u64,
) -> Result<(), OverflowError>;
async fn wait_until_nanos(
&mut self,
value: u64,
) -> Result<(), OverflowError>;
async fn wait_until_micros(
&mut self,
value: u64,
) -> Result<(), OverflowError>;
async fn wait_until_millis(
&mut self,
value: u64,
) -> Result<(), OverflowError>;
async fn wait_until_secs(&mut self, value: u64) -> Result<(), OverflowError>;
}Expand description
An alarm that can be used to wait for a time to come.
Required Methods§
Sourceasync fn wait_until_ticks(&mut self, value: u64) -> Result<(), OverflowError>
async fn wait_until_ticks(&mut self, value: u64) -> Result<(), OverflowError>
Wait until the timer reaches the alarm specified in ticks since the timer has started. If the alarm is already reached, the function exits immediately.
The function returns an overflow error if the alarm value is higher than is supported by the implementation.
Sourceasync fn wait_until_nanos(&mut self, value: u64) -> Result<(), OverflowError>
async fn wait_until_nanos(&mut self, value: u64) -> Result<(), OverflowError>
Wait until the timer reaches the alarm specified in nanoseconds since the timer has started. If the alarm is already reached, the function exits immediately.
The function returns an overflow error if the alarm value is higher than is supported by the implementation.
Sourceasync fn wait_until_micros(&mut self, value: u64) -> Result<(), OverflowError>
async fn wait_until_micros(&mut self, value: u64) -> Result<(), OverflowError>
Wait until the timer reaches the alarm specified in microseconds since the timer has started. If the alarm is already reached, the function exits immediately.
The function returns an overflow error if the alarm value is higher than is supported by the implementation.
Sourceasync fn wait_until_millis(&mut self, value: u64) -> Result<(), OverflowError>
async fn wait_until_millis(&mut self, value: u64) -> Result<(), OverflowError>
Wait until the timer reaches the alarm specified in milliseconds since the timer has started. If the alarm is already reached, the function exits immediately.
The function returns an overflow error if the alarm value is higher than is supported by the implementation.
Sourceasync fn wait_until_secs(&mut self, value: u64) -> Result<(), OverflowError>
async fn wait_until_secs(&mut self, value: u64) -> Result<(), OverflowError>
Wait until the timer reaches the alarm specified in seconds since the timer has started. If the alarm is already reached, the function exits immediately.
The function returns an overflow error if the alarm value is higher than is supported by the implementation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".