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
sourceimpl 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
sourceimpl Add<RelativeDuration> for RelativeDuration
impl Add<RelativeDuration> for RelativeDuration
type Output = RelativeDuration
type Output = RelativeDuration
The resulting type after applying the +
operator.
sourceimpl Clone for RelativeDuration
impl Clone for RelativeDuration
sourcefn clone(&self) -> RelativeDuration
fn clone(&self) -> RelativeDuration
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RelativeDuration
impl Debug for RelativeDuration
sourceimpl Display for RelativeDuration
impl Display for RelativeDuration
sourceimpl Hash for RelativeDuration
impl Hash for RelativeDuration
sourceimpl Ord for RelativeDuration
impl Ord for RelativeDuration
sourceimpl PartialEq<RelativeDuration> for RelativeDuration
impl PartialEq<RelativeDuration> for RelativeDuration
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RelativeDuration) -> bool
fn ne(&self, other: &RelativeDuration) -> bool
This method tests for !=
.
sourceimpl PartialOrd<RelativeDuration> for RelativeDuration
impl PartialOrd<RelativeDuration> for RelativeDuration
sourcefn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &RelativeDuration) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl ScalarArg for RelativeDuration
impl ScalarArg for RelativeDuration
sourceimpl Sub<RelativeDuration> for RelativeDuration
impl Sub<RelativeDuration> for RelativeDuration
type Output = RelativeDuration
type Output = RelativeDuration
The resulting type after applying the -
operator.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> QueryArg for T where
T: ScalarArg,
impl<T> QueryArg for T where
T: ScalarArg,
fn encode_slot(&self, enc: &mut Encoder<'_>) -> Result<(), Error>
fn check_descriptor(
ctx: &DescriptorContext<'_>,
pos: TypePos
) -> Result<(), Error>
sourceimpl<T> Queryable for T where
T: DecodeScalar,
impl<T> Queryable for T where
T: DecodeScalar,
fn decode(_decoder: &Decoder, buf: &[u8]) -> Result<T, DecodeError>
fn check_descriptor(
ctx: &DescriptorContext<'_>,
type_pos: TypePos
) -> Result<(), DescriptorMismatch>
fn decode_optional(
decoder: &Decoder,
buf: Option<&[u8]>
) -> Result<Self, DecodeError>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more