Struct edgedb_protocol::model::DateDuration
source · pub struct DateDuration { /* private fields */ }
Expand description
A type that can represent a human-friendly date duration like 1 month or two days.
Implementations§
source§impl DateDuration
impl DateDuration
pub fn try_from_years(years: i32) -> Result<DateDuration, OutOfRangeError>
pub fn from_years(years: i32) -> DateDuration
pub fn try_from_months(months: i32) -> Result<DateDuration, OutOfRangeError>
pub fn from_months(months: i32) -> DateDuration
pub fn try_from_days(days: i32) -> Result<DateDuration, OutOfRangeError>
pub fn from_days(days: i32) -> DateDuration
pub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
Trait Implementations§
source§impl Add<DateDuration> for DateDuration
impl Add<DateDuration> for DateDuration
source§impl Clone for DateDuration
impl Clone for DateDuration
source§fn clone(&self) -> DateDuration
fn clone(&self) -> DateDuration
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 DateDuration
impl Debug for DateDuration
source§impl Display for DateDuration
impl Display for DateDuration
source§impl Hash for DateDuration
impl Hash for DateDuration
source§impl Ord for DateDuration
impl Ord for DateDuration
source§fn cmp(&self, other: &DateDuration) -> Ordering
fn cmp(&self, other: &DateDuration) -> 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<DateDuration> for DateDuration
impl PartialEq<DateDuration> for DateDuration
source§fn eq(&self, other: &DateDuration) -> bool
fn eq(&self, other: &DateDuration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DateDuration> for DateDuration
impl PartialOrd<DateDuration> for DateDuration
source§fn partial_cmp(&self, other: &DateDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &DateDuration) -> 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 DateDuration
impl ScalarArg for DateDuration
source§impl Sub<DateDuration> for DateDuration
impl Sub<DateDuration> for DateDuration
impl Copy for DateDuration
impl Eq for DateDuration
impl StructuralEq for DateDuration
impl StructuralPartialEq for DateDuration
Auto Trait Implementations§
impl RefUnwindSafe for DateDuration
impl Send for DateDuration
impl Sync for DateDuration
impl Unpin for DateDuration
impl UnwindSafe for DateDuration
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