Struct edgedb_protocol::model::RelativeDuration
source · 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<RelativeDuration> for RelativeDuration
impl Add<RelativeDuration> for RelativeDuration
source§impl Clone for RelativeDuration
impl Clone for RelativeDuration
source§fn clone(&self) -> RelativeDuration
fn clone(&self) -> RelativeDuration
Returns a copy 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<RelativeDuration> for RelativeDuration
impl PartialEq<RelativeDuration> for RelativeDuration
source§fn eq(&self, other: &RelativeDuration) -> bool
fn eq(&self, other: &RelativeDuration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RelativeDuration> for RelativeDuration
impl PartialOrd<RelativeDuration> for RelativeDuration
source§fn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ScalarArg for RelativeDuration
impl ScalarArg for RelativeDuration
source§impl Sub<RelativeDuration> for RelativeDuration
impl Sub<RelativeDuration> for RelativeDuration
impl Copy for RelativeDuration
impl Eq for RelativeDuration
impl StructuralEq for RelativeDuration
impl StructuralPartialEq for RelativeDuration
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§
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