pub struct IntervalValue {
pub months: i32,
pub days: i32,
pub nanos: i64,
}Expand description
Interval value stored as a combination of calendar months, whole days, and nanoseconds.
Months capture both month and year components (12 months == 1 year). Days represent
whole 24-hour periods and nanoseconds account for sub-day precision. This mirrors the
semantics of Arrow’s IntervalMonthDayNano while keeping arithmetic manageable.
Fields§
§months: i32§days: i32§nanos: i64Implementations§
Source§impl IntervalValue
impl IntervalValue
pub const fn new(months: i32, days: i32, nanos: i64) -> Self
pub const fn zero() -> Self
Sourcepub fn from_components(months: i64, days: i64, nanos: i64) -> Result<Self>
pub fn from_components(months: i64, days: i64, nanos: i64) -> Result<Self>
Construct an interval from raw component totals, validating range limits.
pub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_neg(self) -> Option<Self>
pub fn checked_scale(self, factor: i64) -> Option<Self>
pub const fn is_zero(self) -> bool
Trait Implementations§
Source§impl Clone for IntervalValue
impl Clone for IntervalValue
Source§fn clone(&self) -> IntervalValue
fn clone(&self) -> IntervalValue
Returns a duplicate 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 IntervalValue
impl Debug for IntervalValue
Source§impl Default for IntervalValue
impl Default for IntervalValue
Source§fn default() -> IntervalValue
fn default() -> IntervalValue
Returns the “default value” for a type. Read more
Source§impl From<IntervalValue> for Literal
impl From<IntervalValue> for Literal
Source§fn from(v: IntervalValue) -> Self
fn from(v: IntervalValue) -> Self
Converts to this type from the input type.
Source§impl Hash for IntervalValue
impl Hash for IntervalValue
Source§impl PartialEq for IntervalValue
impl PartialEq for IntervalValue
impl Copy for IntervalValue
impl Eq for IntervalValue
impl StructuralPartialEq for IntervalValue
Auto Trait Implementations§
impl Freeze for IntervalValue
impl RefUnwindSafe for IntervalValue
impl Send for IntervalValue
impl Sync for IntervalValue
impl Unpin for IntervalValue
impl UnwindSafe for IntervalValue
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