pub struct RelativeDuration { /* private fields */ }Expand description
A type that can represent a human-friendly duration like 1 month or two days.
Implementations§
Source§impl RelativeDuration
 
impl RelativeDuration
pub fn try_from_years(years: i32) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_years(years: i32) -> RelativeDuration
pub fn try_from_months(months: i32) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_months(months: i32) -> RelativeDuration
pub fn try_from_days(days: i32) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_days(days: i32) -> RelativeDuration
pub fn try_from_hours(hours: i64) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_hours(hours: i64) -> RelativeDuration
pub fn try_from_minutes( minutes: i64, ) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_minutes(minutes: i64) -> RelativeDuration
pub fn try_from_secs(secs: i64) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_secs(secs: i64) -> RelativeDuration
pub fn try_from_millis(millis: i64) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_millis(millis: i64) -> RelativeDuration
pub fn try_from_micros(micros: i64) -> Result<RelativeDuration, OutOfRangeError>
pub fn from_micros(micros: i64) -> RelativeDuration
pub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Trait Implementations§
Source§impl Add for RelativeDuration
 
impl Add for RelativeDuration
Source§impl Clone for RelativeDuration
 
impl Clone for RelativeDuration
Source§fn clone(&self) -> RelativeDuration
 
fn clone(&self) -> RelativeDuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for RelativeDuration
 
impl Debug for RelativeDuration
Source§impl Display for RelativeDuration
 
impl Display for RelativeDuration
Source§impl Hash for RelativeDuration
 
impl Hash for RelativeDuration
Source§impl Ord for RelativeDuration
 
impl Ord for RelativeDuration
Source§fn cmp(&self, other: &RelativeDuration) -> Ordering
 
fn cmp(&self, other: &RelativeDuration) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RelativeDuration
 
impl PartialEq for RelativeDuration
Source§impl PartialOrd for RelativeDuration
 
impl PartialOrd for RelativeDuration
Source§impl ScalarArg for RelativeDuration
 
impl ScalarArg for RelativeDuration
Source§impl Sub for RelativeDuration
 
impl Sub for RelativeDuration
impl Copy for RelativeDuration
impl Eq for RelativeDuration
impl StructuralPartialEq for RelativeDuration
Auto Trait Implementations§
impl Freeze for RelativeDuration
impl RefUnwindSafe for RelativeDuration
impl Send for RelativeDuration
impl Sync for RelativeDuration
impl Unpin for RelativeDuration
impl UnwindSafe for RelativeDuration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> EncoderForExt for Twhere
    T: ?Sized,
 
impl<T> EncoderForExt for Twhere
    T: ?Sized,
Source§fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
    F: 'static,
    Self: EncoderFor<F>,
 
fn to_vec<F>(&self) -> Vec<u8> ⓘwhere
    F: 'static,
    Self: EncoderFor<F>,
Convert this builder into a vector of bytes. This is generally
not the most efficient way to perform serialization.
Source§fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
    F: 'static,
    Self: EncoderFor<F>,
 
fn encode_buffer<F>(&self, buf: &mut [u8]) -> Result<usize, usize>where
    F: 'static,
    Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.
Source§fn encode_buffer_uninit<'a, F>(
    &self,
    buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
    F: 'static,
    Self: EncoderFor<F>,
 
fn encode_buffer_uninit<'a, F>(
    &self,
    buf: &'a mut [MaybeUninit<u8>],
) -> Result<&'a mut [u8], usize>where
    F: 'static,
    Self: EncoderFor<F>,
Encode this builder into a given buffer. If the buffer is
too small, the function will return the number of bytes
required to encode the builder.
fn measure<F>(&self) -> usizewhere
    F: 'static,
    Self: EncoderFor<F>,
Source§impl<T> QueryResult for Twhere
    T: Queryable,
 
impl<T> QueryResult for Twhere
    T: Queryable,
Source§impl<T> Queryable for Twhere
    T: DecodeScalar,
 
impl<T> Queryable for Twhere
    T: DecodeScalar,
Source§type Args = ()
 
type Args = ()
Data returned by Queryable::check_descriptor, that can be used during decoding.
For example, this is used to pass the order of object pointers (which is sent in
type descriptors) to decode function.