Trait CoarseTimeProvider

pub(crate) 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§

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl CoarseTimeProvider for DynTimeProvider

§

impl CoarseTimeProvider for AsyncStdNativeTlsRuntime

§

impl CoarseTimeProvider for AsyncStdRustlsRuntime

§

impl CoarseTimeProvider for PreferredRuntime

§

impl CoarseTimeProvider for RealCoarseTimeProvider

§

impl CoarseTimeProvider for TokioNativeTlsRuntime

§

impl CoarseTimeProvider for TokioRustlsRuntime

§

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