Trait Clock

Source
pub trait Clock {
    // Required methods
    fn get_instant(&self) -> Instant;
    fn compute_system_time_from_instant(
        &self,
        instant: Instant,
    ) -> Result<DateTime<Utc>, OutOfRangeError>;
}

Required Methods§

Source

fn get_instant(&self) -> Instant

Returns current tsc instant

Source

fn compute_system_time_from_instant( &self, instant: Instant, ) -> Result<DateTime<Utc>, OutOfRangeError>

Returns system time from TSC time

Implementors§