Trait time2::DurationExt [] [src]

pub trait DurationExt: Sized {
    fn as_millis(&self) -> Option<u64>;
    fn mul_u64(&self, rhs: u64) -> Option<Self>;
    fn div_u64(&self, rhs: u64) -> Option<Self>;
}

Extensions to the Duration type.

Required Methods

fn as_millis(&self) -> Option<u64>

Returns the number of whole milliseconds contained in this Duration.

Returns None if the value exceeds the capacity of a u64.

fn mul_u64(&self, rhs: u64) -> Option<Self>

Multiplies this Duration.

Like the Mul implementation for Duration, except that it takes a u64 instead of a `u32.

fn div_u64(&self, rhs: u64) -> Option<Self>

Divides this Duration.

Like the Div implementation for Duration, except that it takes a u64 instead of a u32.

Implementors