Trait tor_rtcompat::CoarseTimeProvider

source ·
pub trait CoarseTimeProvider: Clone + Send + Sync + 'static {
    // Required method
    fn now_coarse(&self) -> CoarseInstant;
}
Expand description

A provider of reduced-precision timestamps

This doesn’t provide any facility for sleeping. If you want to sleep based on reduced-precision timestamps, convert the desired sleep duration to std::time::Duration and use SleepProvider.

Required Methods§

source

fn now_coarse(&self) -> CoarseInstant

Return the CoarseTimeProvider’s view of the current instant.

This is supposed to be cheaper than std::time::Instant::now.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl CoarseTimeProvider for AsyncStdNativeTlsRuntime

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl CoarseTimeProvider for AsyncStdRustlsRuntime

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl CoarseTimeProvider for PreferredRuntime

source§

impl CoarseTimeProvider for RealCoarseTimeProvider

source§

impl CoarseTimeProvider for TokioNativeTlsRuntime

Available on (crate features native-tls or rustls) and crate feature tokio only.
source§

impl CoarseTimeProvider for TokioRustlsRuntime

Available on (crate features native-tls or rustls) and crate feature tokio only.
source§

impl<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR> CoarseTimeProvider for CompoundRuntime<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR>
where CoarseTimeR: CoarseTimeProvider + Clone + Send + Sync + 'static, SleepR: Clone + Send + Sync + 'static, SpawnR: Clone + Send + Sync + 'static, TcpR: Clone + Send + Sync + 'static, TlsR: Clone + Send + Sync + 'static, UdpR: Clone + Send + Sync + 'static,