pub struct Interval {
pub months: i64,
pub days: i64,
pub nanos: i128,
}Fields§
§months: i64§days: i64§nanos: i128Implementations§
Source§impl Interval
impl Interval
pub const ZERO: Interval
pub const DAYS_IN_MONTH: f64 = 30f64
pub const DAYS_IN_MONTH_AVG: f64 = 30.436875000000001f64
pub const SECS_IN_DAY: i64 = 86_400i64
pub const NANOS_IN_SEC: i128 = 1_000_000_000i128
pub const NANOS_IN_HOUR: i128 = 3_600_000_000_000i128
pub const NANOS_IN_DAY: i128 = 86_400_000_000_000i128
pub const MICROS_IN_DAY: i128 = 86_400_000_000i128
pub const fn new(months: i64, days: i64, nanos: i128) -> Self
pub const fn from_duration(duration: &Duration) -> Self
pub const fn from_nanos(value: i128) -> Self
pub const fn from_micros(value: i128) -> Self
pub const fn from_millis(value: i128) -> Self
pub const fn from_secs(value: i64) -> Self
pub const fn from_mins(value: i64) -> Self
pub const fn from_hours(value: i64) -> Self
pub const fn from_days(value: i64) -> Self
pub const fn from_weeks(value: i64) -> Self
pub const fn from_months(value: i64) -> Self
pub const fn from_years(value: i64) -> Self
pub const fn as_hmsns(&self) -> (i128, u8, u8, u32)
pub const fn is_zero(&self) -> bool
pub const fn as_duration(&self, days_in_month: f64) -> Duration
pub const fn units_and_factors(&self) -> &[(IntervalUnit, i128)]
pub fn units_mask(&self) -> u8
pub fn unit_value(&self, unit: IntervalUnit) -> i128
Trait Implementations§
Source§impl AddAssign for Interval
impl AddAssign for Interval
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl AsValue for Interval
impl AsValue for Interval
Source§fn as_empty_value() -> Value
fn as_empty_value() -> Value
Return an “empty” (NULL-like) value variant for this type. Used when
constructing composite
Value containers (arrays, maps) or representing
absent optional data. This should never allocate and should not rely on
default trait implementations of Self.Source§fn as_value(self) -> Value
fn as_value(self) -> Value
Convert this value into its owned
Value representation. This should
perform any necessary wrapping (e.g. collections into List, decimals
into Decimal) but avoid lossy transformations unless explicitly
documented.Source§fn try_from_value(value: Value) -> Result<Self>
fn try_from_value(value: Value) -> Result<Self>
Source§impl SubAssign for Interval
impl SubAssign for Interval
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Interval
impl Eq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnwindSafe for Interval
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