embassy/embassy-traits/src/delay.rs

14 lines
358 B
Rust
Raw Normal View History

use core::future::Future;
pub trait Delay {
2021-11-21 09:11:00 +01:00
type DelayFuture<'a>: Future<Output = ()> + 'a
where
Self: 'a;
/// Future that completes after now + millis
2021-10-18 00:55:43 +02:00
fn delay_ms(&mut self, millis: u64) -> Self::DelayFuture<'_>;
/// Future that completes after now + micros
2021-10-18 00:55:43 +02:00
fn delay_us(&mut self, micros: u64) -> Self::DelayFuture<'_>;
}