[−][src]Struct coder::models::Duration
Duration is a wrapper around chrono::Duration that Serializes into and Deserializes from millisecond precision integers.
Methods from Deref<Target = Duration>
pub fn num_weeks(&self) -> i64[src]
Returns the total number of whole weeks in the duration.
pub fn num_days(&self) -> i64[src]
Returns the total number of whole days in the duration.
pub fn num_hours(&self) -> i64[src]
Returns the total number of whole hours in the duration.
pub fn num_minutes(&self) -> i64[src]
Returns the total number of whole minutes in the duration.
pub fn num_seconds(&self) -> i64[src]
Returns the total number of whole seconds in the duration.
pub fn num_milliseconds(&self) -> i64[src]
Returns the total number of whole milliseconds in the duration,
pub 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).
pub 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).
pub fn checked_add(&self, rhs: &Duration) -> Option<Duration>[src]
Add two durations, returning None if overflow occurred.
pub fn checked_sub(&self, rhs: &Duration) -> Option<Duration>[src]
Subtract two durations, returning None if overflow occurred.
pub fn is_zero(&self) -> bool[src]
Returns true if the duration equals Duration::zero().
pub 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 Clone for Duration[src]
impl Debug for Duration[src]
impl Deref for Duration[src]
impl<'de> Deserialize<'de> for Duration[src]
fn deserialize<D>(deserializer: D) -> Result<Duration, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
impl PartialEq<Duration> for Duration[src]
impl Serialize for Duration[src]
impl StructuralPartialEq for Duration[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
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.
fn to_owned(&self) -> T[src]
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.
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>,