Trait clokwerk::timeprovider::TimeProvider[][src]

pub trait TimeProvider {
    fn now<Tz>(tz: &Tz) -> DateTime<Tz>
    where
        Tz: TimeZone + Sync + Send
; }

A trait for providing custom time providers. TimeProviders are used to specify where the source of DateTimes used by the scheduler. For most purposes, the default ChronoTimeProvider is sufficient; the main use case for custom TimeProviders is for writing tests.

Required methods

fn now<Tz>(tz: &Tz) -> DateTime<Tz> where
    Tz: TimeZone + Sync + Send
[src]

Returns the current time, according to the TimeProvider

Loading content...

Implementors

impl TimeProvider for ChronoTimeProvider[src]

fn now<Tz>(tz: &Tz) -> DateTime<Tz> where
    Tz: TimeZone + Sync + Send
[src]

Returns the current time, according to chrono

Loading content...