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.
fn add(self, rhs: Duration) -> RelativeDuration
[src]
impl Add<RelativeDuration> for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the +
operator.
fn add(self, rhs: RelativeDuration) -> RelativeDuration
[src]
impl Clone for RelativeDuration
[src]
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.
fn div(self, rhs: i32) -> RelativeDuration
[src]
impl Eq for RelativeDuration
[src]
impl From<Duration> for RelativeDuration
[src]
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.
fn mul(self, rhs: i32) -> RelativeDuration
[src]
impl Neg for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the -
operator.
fn neg(self) -> RelativeDuration
[src]
impl Ord for RelativeDuration
[src]
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]
fn eq(&self, other: &RelativeDuration) -> bool
[src]
fn ne(&self, other: &RelativeDuration) -> bool
[src]
impl PartialOrd<RelativeDuration> for RelativeDuration
[src]
fn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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.
fn sub(self, rhs: Duration) -> RelativeDuration
[src]
impl Sub<RelativeDuration> for RelativeDuration
[src]
type Output = RelativeDuration
The resulting type after applying the -
operator.
fn sub(self, rhs: RelativeDuration) -> RelativeDuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for RelativeDuration
impl Send for RelativeDuration
impl Sync for RelativeDuration
impl Unpin for RelativeDuration
impl UnwindSafe for RelativeDuration
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>,