Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Send + Sync {
    // Required methods
    fn now_ms(&self) -> i64;
    fn local_minute(&self, timestamp_ms: i64) -> u16;
    fn sleep_until(
        &self,
        deadline_ms: i64,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
}

Required Methods§

Source

fn now_ms(&self) -> i64

Source

fn local_minute(&self, timestamp_ms: i64) -> u16

Source

fn sleep_until( &self, deadline_ms: i64, ) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§