Enum timeago::TimeUnit[][src]

pub enum TimeUnit {
    Nanoseconds,
    Microseconds,
    Milliseconds,
    Seconds,
    Minutes,
    Hours,
    Days,
    Weeks,
    Months,
    Years,
}

Various units of time to specify as maximum or minimum. Note that calculations are approximate, not calendar-based.

Variants

Nanoseconds
Microseconds
Milliseconds
Seconds
Minutes
Hours
Days
Weeks
Months
Years

Implementations

impl TimeUnit[src]

pub fn min_duration(&self) -> Duration[src]

Get std::time::Duration corresponding to minimum duration that is representable by this time unit.

pub fn bigger_unit(&self) -> Option<TimeUnit>[src]

“Upgrade” minutes to hours, hours to days and so on.

pub fn smaller_unit(&self) -> Option<TimeUnit>[src]

“Downgrade” weeks to days, seconds to milliseconds and so on.

Trait Implementations

impl Clone for TimeUnit[src]

impl Copy for TimeUnit[src]

impl Debug for TimeUnit[src]

impl Eq for TimeUnit[src]

impl Hash for TimeUnit[src]

impl Ord for TimeUnit[src]

impl PartialEq<TimeUnit> for TimeUnit[src]

impl PartialOrd<TimeUnit> for TimeUnit[src]

impl StructuralEq for TimeUnit[src]

impl StructuralPartialEq for TimeUnit[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.