Trait mockable::Clock

source ·
pub trait Clock: Send + Sync {
    // Required methods
    fn local(&self) -> DateTime<Local>;
    fn utc(&self) -> DateTime<Utc>;
}
Expand description

A trait for getting the current time.

This is supported on feature=clock only.

Example.

Required Methods§

source

fn local(&self) -> DateTime<Local>

Returns the current time in the local timezone.

source

fn utc(&self) -> DateTime<Utc>

Returns the current time in UTC.

Implementors§