futures_intrusive::timer

Trait Timer

Source
pub trait Timer {
    // Required methods
    fn delay(&self, delay: Duration) -> TimerFuture<'_> ;
    fn deadline(&self, timestamp: u64) -> TimerFuture<'_> ;
}
Expand description

An asynchronously awaitable thread-safe timer.

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) -> TimerFuture<'_>

Returns a future that gets fulfilled after the given Duration

Source

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

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

Implementors§

Source§

impl<MutexType> Timer for GenericTimerService<MutexType>
where MutexType: Sync + RawMutex,