Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Debug
    + Send
    + Sync {
    // Required method
    fn now(&self) -> Timestamp;
}
Expand description

The domain’s only source of “now”.

b1’s Definition of Done requires that recovery decisions be testable with no real time dependency, so every function in this crate that compares timestamps takes one of these rather than calling the system clock.

Required Methods§

Source

fn now(&self) -> Timestamp

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Clock + ?Sized> Clock for &T

Source§

fn now(&self) -> Timestamp

Source§

impl<T: Clock + ?Sized> Clock for Arc<T>

Source§

fn now(&self) -> Timestamp

Implementors§