[−][src]Struct chronoutil::relative_duration::RelativeDuration
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.
pub fn add(self, rhs: Duration) -> RelativeDuration
[src]
impl Add<RelativeDuration> for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> RelativeDuration
[src]
impl Add<RelativeDuration> for Duration
[src]
type Output = RelativeDuration
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> RelativeDuration
[src]
impl Add<RelativeDuration> for NaiveDate
[src]
type Output = NaiveDate
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> NaiveDate
[src]
impl Add<RelativeDuration> for NaiveDateTime
[src]
type Output = NaiveDateTime
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> NaiveDateTime
[src]
impl<Tz> Add<RelativeDuration> for Date<Tz> where
Tz: TimeZone,
[src]
Tz: TimeZone,
type Output = Date<Tz>
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> Date<Tz>
[src]
impl<Tz> Add<RelativeDuration> for DateTime<Tz> where
Tz: TimeZone,
[src]
Tz: TimeZone,
type Output = DateTime<Tz>
The resulting type after applying the +
operator.
pub fn add(self, rhs: RelativeDuration) -> DateTime<Tz>
[src]
impl Clone for RelativeDuration
[src]
pub fn clone(&self) -> RelativeDuration
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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.
pub fn div(self, rhs: i32) -> RelativeDuration
[src]
impl Eq for RelativeDuration
[src]
impl From<Duration> for RelativeDuration
[src]
impl From<Duration> for RelativeDuration
[src]
pub 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.
pub fn mul(self, rhs: i32) -> RelativeDuration
[src]
impl Neg for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the -
operator.
pub fn neg(self) -> RelativeDuration
[src]
impl Ord for RelativeDuration
[src]
pub fn cmp(&self, other: &RelativeDuration) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<RelativeDuration> for RelativeDuration
[src]
pub fn eq(&self, other: &RelativeDuration) -> bool
[src]
pub fn ne(&self, other: &RelativeDuration) -> bool
[src]
impl PartialOrd<RelativeDuration> for RelativeDuration
[src]
pub fn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
[src]
pub fn lt(&self, other: &RelativeDuration) -> bool
[src]
pub fn le(&self, other: &RelativeDuration) -> bool
[src]
pub fn gt(&self, other: &RelativeDuration) -> bool
[src]
pub fn ge(&self, other: &RelativeDuration) -> bool
[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.
pub fn sub(self, rhs: Duration) -> RelativeDuration
[src]
impl Sub<RelativeDuration> for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the -
operator.
pub fn sub(self, rhs: RelativeDuration) -> RelativeDuration
[src]
impl Sub<RelativeDuration> for Duration
[src]
type Output = RelativeDuration
The resulting type after applying the -
operator.
pub fn sub(self, rhs: RelativeDuration) -> RelativeDuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for RelativeDuration
[src]
impl Send for RelativeDuration
[src]
impl Sync for RelativeDuration
[src]
impl Unpin for RelativeDuration
[src]
impl UnwindSafe for RelativeDuration
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,