struct Interval {
months: i32,
days: i32,
nanos: i64,
}
Fields§
§months: i32
§days: i32
§nanos: i64
Implementations§
Source§impl Interval
impl Interval
fn new(months: i32, days: i32, nanos: i64) -> Self
fn to_year_months(&self) -> Result<i32, ArrowError>
fn to_day_time(&self) -> Result<(i32, i32), ArrowError>
fn to_month_day_nanos(&self) -> (i32, i32, i64)
Sourcefn parse(value: &str, config: &IntervalParseConfig) -> Result<Self, ArrowError>
fn parse(value: &str, config: &IntervalParseConfig) -> Result<Self, ArrowError>
Parse string value in traditional Postgres format such as
1 year 2 months 3 days 4 hours 5 minutes 6 seconds
Sourcefn add(
&self,
amount: IntervalAmount,
unit: IntervalUnit,
) -> Result<Self, ArrowError>
fn add( &self, amount: IntervalAmount, unit: IntervalUnit, ) -> Result<Self, ArrowError>
Interval addition following Postgres behavior. Fractional units will be spilled into smaller units. When the interval unit is larger than months, the result is rounded to total months and not spilled to days/nanos. Fractional parts of weeks and days are represented using days and nanoseconds. e.g. INTERVAL ‘0.5 MONTH’ = 15 days, INTERVAL ‘1.5 MONTH’ = 1 month 15 days e.g. INTERVAL ‘0.5 DAY’ = 12 hours, INTERVAL ‘1.5 DAY’ = 1 day 12 hours Postgres reference
Trait Implementations§
impl StructuralPartialEq 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