Trait futures_intrusive::timer::LocalTimer
source · pub trait LocalTimer {
fn delay(&self, delay: Duration) -> LocalTimerFuture<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
;
fn deadline(&self, timestamp: u64) -> LocalTimerFuture<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
;
}
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<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
fn delay(&self, delay: Duration) -> LocalTimerFuture<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
Returns a future that gets fulfilled after the given Duration
sourcefn deadline(&self, timestamp: u64) -> LocalTimerFuture<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
fn deadline(&self, timestamp: u64) -> LocalTimerFuture<'_>ⓘNotable traits for LocalTimerFuture<'a>impl<'a> Future for LocalTimerFuture<'a> type Output = ();
Returns a future that gets fulfilled when the utilized Clock
reaches
the given timestamp.