Struct diesel_chrono_duration::ChronoDurationProxy
[−]
[src]
pub struct ChronoDurationProxy(pub Duration);
Methods from Deref<Target = Duration>
fn num_weeks(&self) -> i64
[src]
Returns the total number of whole weeks in the duration.
fn num_days(&self) -> i64
[src]
Returns the total number of whole days in the duration.
fn num_hours(&self) -> i64
[src]
Returns the total number of whole hours in the duration.
fn num_minutes(&self) -> i64
[src]
Returns the total number of whole minutes in the duration.
fn num_seconds(&self) -> i64
[src]
Returns the total number of whole seconds in the duration.
fn num_milliseconds(&self) -> i64
[src]
Returns the total number of whole milliseconds in the duration,
fn num_microseconds(&self) -> Option<i64>
[src]
Returns the total number of whole microseconds in the duration,
or None
on overflow (exceeding 263 microseconds in either direction).
fn num_nanoseconds(&self) -> Option<i64>
[src]
Returns the total number of whole nanoseconds in the duration,
or None
on overflow (exceeding 263 nanoseconds in either direction).
fn checked_add(&self, rhs: &Duration) -> Option<Duration>
[src]
Add two durations, returning None
if overflow occurred.
fn checked_sub(&self, rhs: &Duration) -> Option<Duration>
[src]
Subtract two durations, returning None
if overflow occurred.
fn is_zero(&self) -> bool
[src]
Returns true
if the duration equals Duration::zero()
.
fn to_std(&self) -> Result<Duration, OutOfRangeError>
[src]
Creates a std::time::Duration
object from time::Duration
This function errors when duration is less than zero. As standard library implementation is limited to non-negative values.
Trait Implementations
impl Debug for ChronoDurationProxy
[src]
impl Copy for ChronoDurationProxy
[src]
impl Clone for ChronoDurationProxy
[src]
fn clone(&self) -> ChronoDurationProxy
[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 ChronoDurationProxy
[src]
fn eq(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests for !=
.
impl Eq for ChronoDurationProxy
[src]
impl PartialOrd for ChronoDurationProxy
[src]
fn partial_cmp(&self, __arg_0: &ChronoDurationProxy) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &ChronoDurationProxy) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for ChronoDurationProxy
[src]
fn cmp(&self, __arg_0: &ChronoDurationProxy) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl From<Duration> for ChronoDurationProxy
[src]
fn from(duration: Duration) -> ChronoDurationProxy
[src]
Performs the conversion.
impl AsRef<Duration> for ChronoDurationProxy
[src]
impl Deref for ChronoDurationProxy
[src]
type Target = Duration
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl<DB> ToSql<BigInt, DB> for ChronoDurationProxy where
i64: ToSql<BigInt, DB>,
DB: Backend,
[src]
i64: ToSql<BigInt, DB>,
DB: Backend,
impl<DB> FromSql<BigInt, DB> for ChronoDurationProxy where
i64: FromSql<BigInt, DB>,
DB: Backend,
[src]
i64: FromSql<BigInt, DB>,
DB: Backend,