Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required methods
    fn now(&self) -> Timestamp;
    fn boot_now(&self) -> Timestamp;
    fn sleep(&self, d: Millis);
}

Required Methods§

Source

fn now(&self) -> Timestamp

Wall-clock time: for what people see and records compared across boots.

Source

fn boot_now(&self) -> Timestamp

Milliseconds on CLOCK_BOOTTIME: for everything that does not survive a reboot (approval tokens, leases, cooldowns, windows; §12h). Moving the wall clock never moves it.

Source

fn sleep(&self, d: Millis)

Implementors§