Struct oxsdatatypes::Duration
source · pub struct Duration { /* private fields */ }
Expand description
It stores the duration using a pair of a YearMonthDuration
and a DayTimeDuration
.
Implementations§
source§impl Duration
impl Duration
pub fn new(months: impl Into<i64>, seconds: impl Into<Decimal>) -> Self
pub fn from_be_bytes(bytes: [u8; 24]) -> Self
pub fn to_be_bytes(self) -> [u8; 24]
sourcepub fn checked_add(&self, rhs: impl Into<Self>) -> Option<Self>
pub fn checked_add(&self, rhs: impl Into<Self>) -> Option<Self>
sourcepub fn checked_sub(&self, rhs: impl Into<Self>) -> Option<Self>
pub fn checked_sub(&self, rhs: impl Into<Self>) -> Option<Self>
pub fn checked_neg(&self) -> Option<Self>
sourcepub fn is_identical_with(&self, other: &Self) -> bool
pub fn is_identical_with(&self, other: &Self) -> bool
Checks if the two values are identical.
Trait Implementations§
source§impl From<DayTimeDuration> for Duration
impl From<DayTimeDuration> for Duration
source§fn from(value: DayTimeDuration) -> Self
fn from(value: DayTimeDuration) -> Self
Converts to this type from the input type.
source§impl From<TimezoneOffset> for Duration
impl From<TimezoneOffset> for Duration
source§fn from(value: TimezoneOffset) -> Self
fn from(value: TimezoneOffset) -> Self
Converts to this type from the input type.
source§impl From<YearMonthDuration> for Duration
impl From<YearMonthDuration> for Duration
source§fn from(value: YearMonthDuration) -> Self
fn from(value: YearMonthDuration) -> Self
Converts to this type from the input type.
source§impl FromStr for Duration
impl FromStr for Duration
§type Err = XsdParseError
type Err = XsdParseError
The associated error which can be returned from parsing.
source§impl PartialEq<DayTimeDuration> for Duration
impl PartialEq<DayTimeDuration> for Duration
source§fn eq(&self, other: &DayTimeDuration) -> bool
fn eq(&self, other: &DayTimeDuration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Duration> for DayTimeDuration
impl PartialEq<Duration> for DayTimeDuration
source§impl PartialEq<Duration> for Duration
impl PartialEq<Duration> for Duration
source§impl PartialEq<Duration> for YearMonthDuration
impl PartialEq<Duration> for YearMonthDuration
source§impl PartialEq<YearMonthDuration> for Duration
impl PartialEq<YearMonthDuration> for Duration
source§fn eq(&self, other: &YearMonthDuration) -> bool
fn eq(&self, other: &YearMonthDuration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DayTimeDuration> for Duration
impl PartialOrd<DayTimeDuration> for Duration
source§fn partial_cmp(&self, other: &DayTimeDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &DayTimeDuration) -> 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 PartialOrd<Duration> for DayTimeDuration
impl PartialOrd<Duration> for DayTimeDuration
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 PartialOrd<Duration> for Duration
impl PartialOrd<Duration> for Duration
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 PartialOrd<Duration> for YearMonthDuration
impl PartialOrd<Duration> for YearMonthDuration
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 PartialOrd<YearMonthDuration> for Duration
impl PartialOrd<YearMonthDuration> for Duration
source§fn partial_cmp(&self, other: &YearMonthDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &YearMonthDuration) -> 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 TryFrom<Duration> for DayTimeDuration
impl TryFrom<Duration> for DayTimeDuration
§type Error = DecimalOverflowError
type Error = DecimalOverflowError
The type returned in the event of a conversion error.
source§impl TryFrom<Duration> for Duration
impl TryFrom<Duration> for Duration
§type Error = DecimalOverflowError
type Error = DecimalOverflowError
The type returned in the event of a conversion error.
source§fn try_from(value: StdDuration) -> Result<Self, DecimalOverflowError>
fn try_from(value: StdDuration) -> Result<Self, DecimalOverflowError>
Performs the conversion.
source§impl TryFrom<Duration> for TimezoneOffset
impl TryFrom<Duration> for TimezoneOffset
§type Error = DateTimeError
type Error = DateTimeError
The type returned in the event of a conversion error.
source§impl TryFrom<Duration> for YearMonthDuration
impl TryFrom<Duration> for YearMonthDuration
§type Error = DecimalOverflowError
type Error = DecimalOverflowError
The type returned in the event of a conversion error.
impl Copy for Duration
impl Eq for Duration
impl StructuralEq for Duration
impl StructuralPartialEq for Duration
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§
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