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.

Implementations

impl Duration[src]

pub fn zero() -> Self[src]

Create a new zero-length duration.

pub fn of(seconds: i64) -> Self[src]

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

pub fn of_ms(seconds: i64, milliseconds: i16) -> Self[src]

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

pub fn lengths(&self) -> (i64, i16)[src]

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

Trait Implementations

impl Add<Duration> for LocalDateTime[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Duration> for Duration[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Duration> for Instant[src]

type Output = Self

The resulting type after applying the + operator.

impl Clone for Duration[src]

impl Copy for Duration[src]

impl Debug for Duration[src]

impl Eq for Duration[src]

impl Mul<i64> for Duration[src]

type Output = Self

The resulting type after applying the * operator.

impl PartialEq<Duration> for Duration[src]

impl StructuralEq for Duration[src]

impl StructuralPartialEq for Duration[src]

impl Sub<Duration> for LocalDateTime[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Duration> for Duration[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Duration> for Instant[src]

type Output = Self

The resulting type after applying the - operator.

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.