pub struct IntervalFields {
pub months: i32,
pub days: i32,
pub micros: i64,
}Expand description
The months, days and microseconds of an interval.
Fields§
§months: i32§days: i32§micros: i64Implementations§
Source§impl IntervalFields
impl IntervalFields
pub const ZERO: Self
Sourcepub fn of(value: &TemporalValue) -> Option<Self>
pub fn of(value: &TemporalValue) -> Option<Self>
The fields of an interval value, or None for any other temporal value.
pub fn value(self) -> TemporalValue
Sourcepub fn justify_hours(self) -> Result<Self>
pub fn justify_hours(self) -> Result<Self>
interval_justify_hours: whole days of the time field move into the day field, then a day and a time of opposite signs trade one day so that both take one sign.
Sourcepub fn justify_days(self) -> Result<Self>
pub fn justify_days(self) -> Result<Self>
interval_justify_days: whole 30-day months of the day field move into the month field, then a month and a day of opposite signs trade one month.
Sourcepub fn justify_interval(self) -> Result<Self>
pub fn justify_interval(self) -> Result<Self>
interval_justify_interval: justify_hours and justify_days together, so that all three fields take one sign. Days are carried into months first when day and time share a sign, which keeps the day field from overflowing.
Trait Implementations§
Source§impl Clone for IntervalFields
impl Clone for IntervalFields
impl Copy for IntervalFields
Source§impl Debug for IntervalFields
impl Debug for IntervalFields
impl Eq for IntervalFields
Source§impl PartialEq for IntervalFields
impl PartialEq for IntervalFields
impl StructuralPartialEq for IntervalFields
Auto Trait Implementations§
impl Freeze for IntervalFields
impl RefUnwindSafe for IntervalFields
impl Send for IntervalFields
impl Sync for IntervalFields
impl Unpin for IntervalFields
impl UnsafeUnpin for IntervalFields
impl UnwindSafe for IntervalFields
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more