Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required methods
    fn now(&self) -> Timestamp;
    fn today(&self) -> Date;
}
Expand description

Injected time source — deterministic in tests.

Required Methods§

Source

fn now(&self) -> Timestamp

Source

fn today(&self) -> Date

Today’s date, for due:today / overdue.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§