Skip to main content

Module timer

Module timer 

Source
Expand description

Definitions for SleepProviderExt and related types.

Re-exportsยง

use crate::traits::SleepProvider; ๐Ÿ”’
use futures::Future; ๐Ÿ”’
use futures::FutureExt; ๐Ÿ”’
use pin_project::pin_project; ๐Ÿ”’
use std::pin::Pin; ๐Ÿ”’
use std::task::Context; ๐Ÿ”’
use std::task::Poll; ๐Ÿ”’
use web_time_compat::Duration; ๐Ÿ”’
use web_time_compat::Instant; ๐Ÿ”’
use web_time_compat::SystemTime; ๐Ÿ”’

Structsยง

SleepUntilWallclock
A future implementing SleepProviderExt::sleep_until_wallclock.
Timeout
A timeout returned by SleepProviderExt::timeout.
TimeoutError
An error value given when a function times out.

Constantsยง

MAX_SLEEP ๐Ÿ”’
We never sleep more than this much, in case our system clock jumps.

Traitsยง

SleepProviderExt
An extension trait on SleepProvider for timeouts and clock delays.

Functionsยง

calc_next_delay ๐Ÿ”’
Return the amount of time we should wait next, when running sleep_until_wallclock(). Also return a boolean indicating whether we expect this to be the final delay.