Struct datetime::Duration [] [src]

pub struct Duration {
    // some fields omitted
}

A duration is a length of time on the timeline, irrespective of time zone or calendar format, with millisecond precision.

Methods

impl Duration
[src]

fn zero() -> Duration

Create a new zero-length duration.

fn of(seconds: i64) -> Duration

Create a new duration that’s the given number of seconds long.

fn of_ms(seconds: i64, milliseconds: i16) -> Duration

Create a new duration that’s the given number of seconds and milliseconds long.

fn lengths(&self) -> (i64, i16)

Return the seconds and milliseconds portions of the duration as a 2-element tuple.

Trait Implementations

impl Copy for Duration
[src]

impl Debug for Duration
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Eq for Duration
[src]

impl PartialEq for Duration
[src]

fn eq(&self, __arg_0: &Duration) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Duration) -> bool

This method tests for !=.

impl Clone for Duration
[src]

fn clone(&self) -> Duration

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

impl Add<Duration> for Duration
[src]

type Output = Duration

The resulting type after applying the + operator

fn add(self, rhs: Duration) -> Duration

The method for the + operator

impl Sub<Duration> for Duration
[src]

type Output = Duration

The resulting type after applying the - operator

fn sub(self, rhs: Duration) -> Duration

The method for the - operator

impl Mul<i64> for Duration
[src]

type Output = Duration

The resulting type after applying the * operator

fn mul(self, amount: i64) -> Duration

The method for the * operator