pub enum DurationKind {
YearMonth,
DayTime,
}Expand description
The two duration kinds, which do not mix.
A year-month duration plus a day-time duration is a type error and not a normalisation, because a month is not a number of days. An engine that stores months, days and nanoseconds in one value has to invent an answer for “one month after 31 January” and the standard does not ask it to. zu stores two types and refuses the arithmetic that would need the invention.
Variants§
Trait Implementations§
Source§impl Clone for DurationKind
impl Clone for DurationKind
impl Copy for DurationKind
Source§impl Debug for DurationKind
impl Debug for DurationKind
impl Eq for DurationKind
Source§impl Hash for DurationKind
impl Hash for DurationKind
Source§impl Ord for DurationKind
impl Ord for DurationKind
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DurationKind
impl PartialEq for DurationKind
Source§impl PartialOrd for DurationKind
impl PartialOrd for DurationKind
impl StructuralPartialEq for DurationKind
Auto Trait Implementations§
impl Forget for DurationKind
impl Freeze for DurationKind
impl Move for DurationKind
impl RefUnwindSafe for DurationKind
impl Send for DurationKind
impl Sync for DurationKind
impl Unpin for DurationKind
impl UnsafeUnpin for DurationKind
impl UnwindSafe for DurationKind
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