pub trait LocalTimer {
// Required methods
fn delay(&self, delay: Duration) -> LocalTimerFuture<'_> ⓘ;
fn deadline(&self, timestamp: u64) -> LocalTimerFuture<'_> ⓘ;
}
Expand description
An asynchronously awaitable timer which is bound to a thread.
The timer operates on millisecond precision and makes use of a configurable clock source.
The timer allows to wait asynchronously either for a certain duration,
or until the provided Clock
reaches a certain timestamp.
Required Methods§
Sourcefn delay(&self, delay: Duration) -> LocalTimerFuture<'_> ⓘ
fn delay(&self, delay: Duration) -> LocalTimerFuture<'_> ⓘ
Returns a future that gets fulfilled after the given Duration