futures_intrusive::timer

Trait LocalTimer

Source
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§

Source

fn delay(&self, delay: Duration) -> LocalTimerFuture<'_>

Returns a future that gets fulfilled after the given Duration

Source

fn deadline(&self, timestamp: u64) -> LocalTimerFuture<'_>

Returns a future that gets fulfilled when the utilized Clock reaches the given timestamp.

Implementors§

Source§

impl<MutexType: RawMutex> LocalTimer for GenericTimerService<MutexType>