Struct datetime::Duration
[−]
[src]
pub struct Duration { /* 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
[src]
Create a new zero-length duration.
fn of(seconds: i64) -> Duration
[src]
Create a new duration that’s the given number of seconds long.
fn of_ms(seconds: i64, milliseconds: i16) -> Duration
[src]
Create a new duration that’s the given number of seconds and milliseconds long.
fn lengths(&self) -> (i64, i16)
[src]
Return the seconds and milliseconds portions of the duration as a 2-element tuple.
Trait Implementations
impl Clone for Duration
[src]
fn clone(&self) -> Duration
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Duration
[src]
fn eq(&self, __arg_0: &Duration) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Duration) -> bool
[src]
This method tests for !=
.
impl Eq for Duration
[src]
impl Debug for Duration
[src]
impl Copy for Duration
[src]
impl Add<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
fn add(self, rhs: Duration) -> Duration
[src]
Performs the +
operation.
impl Sub<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
fn sub(self, rhs: Duration) -> Duration
[src]
Performs the -
operation.