2021-03-02 15:45:22 +01:00
|
|
|
use core::future::Future;
|
|
|
|
use core::pin::Pin;
|
|
|
|
|
|
|
|
pub trait Delay {
|
|
|
|
type DelayFuture<'a>: Future<Output = ()> + 'a;
|
|
|
|
|
2021-03-22 02:30:03 +01:00
|
|
|
/// Future that completes after now + millis
|
2021-03-02 15:45:22 +01:00
|
|
|
fn delay_ms<'a>(self: Pin<&'a mut Self>, millis: u64) -> Self::DelayFuture<'a>;
|
2021-03-22 02:30:03 +01:00
|
|
|
|
|
|
|
/// Future that completes after now + micros
|
2021-03-02 15:45:22 +01:00
|
|
|
fn delay_us<'a>(self: Pin<&'a mut Self>, micros: u64) -> Self::DelayFuture<'a>;
|
|
|
|
}
|