Struct chronoutil::relative_duration::RelativeDuration[][src]

pub struct RelativeDuration { /* fields omitted */ }

Relative time duration extending Chrono’s Duration.

Implementations

impl RelativeDuration[src]

pub fn years(years: i32) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of years.

Equivalent to RealtiveDuration::months(years * 12) with overflow checks. Panics when the duration is out of bounds.

pub fn months(months: i32) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of months. Panics when the duration is out of bounds.

pub fn weeks(weeks: i64) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of weeks. Panics when the duration is out of bounds.

pub fn days(days: i64) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of days. Panics when the duration is out of bounds.

pub fn hours(hours: i64) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of hours. Panics when the duration is out of bounds.

pub fn minutes(minutes: i64) -> RelativeDuration[src]

Makes a new RelativeDuration with given number of minutes. Panics when the duration is out of bounds.

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

Makes a new RelativeDuration with given number of seconds. Panics when the duration is out of bounds.

pub fn with_duration(self, duration: Duration) -> RelativeDuration[src]

Update the Duration part of the current RelativeDuration.

Trait Implementations

impl Add<Duration> for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the + operator.

impl Add<RelativeDuration> for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the + operator.

impl Clone for RelativeDuration[src]

impl Copy for RelativeDuration[src]

impl Debug for RelativeDuration[src]

impl Div<i32> for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the / operator.

impl Eq for RelativeDuration[src]

impl From<Duration> for RelativeDuration[src]

fn from(item: Duration) -> Self[src]

Makes a new RelativeDuration from a chrono::Duration.

impl From<Duration> for RelativeDuration[src]

fn from(item: StdDuration) -> Self[src]

Makes a new RelativeDuration from a std Duration.

impl Mul<i32> for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the * operator.

impl Neg for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the - operator.

impl Ord for RelativeDuration[src]

impl PartialEq<RelativeDuration> for RelativeDuration[src]

impl PartialOrd<RelativeDuration> for RelativeDuration[src]

impl StructuralEq for RelativeDuration[src]

impl StructuralPartialEq for RelativeDuration[src]

impl Sub<Duration> for RelativeDuration[src]

type Output = RelativeDuration

The resulting type after applying the - operator.

impl Sub<RelativeDuration> for RelativeDuration[src]

type Output = RelativeDuration

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.