[][src]Trait clokwerk::TimeUnits

pub trait TimeUnits: Sized {
    fn seconds(self) -> Interval;
fn minutes(self) -> Interval;
fn hours(self) -> Interval;
fn days(self) -> Interval;
fn weeks(self) -> Interval; fn second(self) -> Interval { ... }
fn minute(self) -> Interval { ... }
fn hour(self) -> Interval { ... }
fn day(self) -> Interval { ... }
fn week(self) -> Interval { ... } }

A trait for easily expressing common intervals. Each method generates an appropriate Interval. Plural and non-plural forms behave identically, but exist to make code more grammatical.

assert_eq!(5.seconds(), Interval::Seconds(5));
assert_eq!(12.minutes(), Interval::Minutes(12));
assert_eq!(2.hours(), Interval::Hours(2));
assert_eq!(3.days(), Interval::Days(3));
assert_eq!(1.week(), Interval::Weeks(1));

Required methods

fn seconds(self) -> Interval

fn minutes(self) -> Interval

fn hours(self) -> Interval

fn days(self) -> Interval

fn weeks(self) -> Interval

Loading content...

Provided methods

fn second(self) -> Interval

fn minute(self) -> Interval

fn hour(self) -> Interval

fn day(self) -> Interval

fn week(self) -> Interval

Loading content...

Implementations on Foreign Types

impl TimeUnits for u32[src]

Loading content...

Implementors

Loading content...