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
Nanosecond
One billionth of a second.
Millisecond
One thousandth of a second
Second
One full second
Minute
60 Seconds
Hour
60 Minutes
Day
24 Hours
Week
7 Days
Year
52 Weeks
Methods
impl TimeUnit
[src]
fn to(&self, to: TimeUnit, amount: u64) -> u64
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]
impl Copy for TimeUnit
[src]
impl Clone for TimeUnit
[src]
fn clone(&self) -> TimeUnit
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more