Enum chroniker::units::TimeUnit [] [src]

pub enum TimeUnit {
    Nanosecond,
    Millisecond,
    Second,
    Minute,
    Hour,
    Day,
    Week,
    Year,
}

The different Units supported by the chroniker library

Variants

One billionth of a second.

One thousandth of a second

One full second

60 Seconds

60 Minutes

24 Hours

7 Days

52 Weeks

Methods

impl TimeUnit
[src]

Converts a unit to another unit. See the example called "units"

Examples

To convert one hour to nanoseconds:

use chroniker::units::TimeUnit;

let nano_in_hour = TimeUnit::Hour.to(TimeUnit::Nanosecond, 1);
println!("In one Hour there are {} nanosecond(s)", nano_in_hour);

Trait Implementations

impl Debug for TimeUnit
[src]

Formats the value using the given formatter.

impl Copy for TimeUnit
[src]

impl Clone for TimeUnit
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more