Skip to main content

Clock

Trait Clock 

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

Clock trait for obtaining current time

Implementations include SystemClock for wall-clock time and MonotonicClock for elapsed timing.

Required Methods§

Source

fn now(&self) -> DateTime

Current date and time

Source

fn today(&self) -> Date

Today’s date

Source

fn time_now(&self) -> Time

Current time of day

Implementors§