pub struct DurationValue {
pub months: i64,
pub days: i64,
pub seconds: i64,
pub nanos: i64,
}Expand description
A Cypher duration: months and days are kept distinct (a month is not a fixed
number of days), with everything finer than a day carried in nanos
(integer nanoseconds — exact even for very large sub-day spans, unlike an
f64 seconds count whose mantissa drops sub-second precision past ~1e15ns).
A typed Cypher duration (ADR 0009 / #1011): signed months / days kept
distinct (a month is not a fixed number of days), and the sub-day time split
into whole seconds plus nanos-of-second. Splitting seconds from nanos lets
a billion-year duration.inSeconds (~6.3e16 s) fit i64, where a single
total-nanos field would overflow (~6.3e25 ns); months: i64 likewise holds
the ~24e9-month spans duration.between can produce. nanos is in
(-1e9, 1e9) and shares the sign of seconds (truncating split).
Fields§
§months: i64Signed whole months.
days: i64Signed whole days.
seconds: i64Signed whole sub-day seconds (carries the sub-day sign).
nanos: i64Nanoseconds-of-second, always [0, 1e9) (the Neo4j/openCypher canonical
form — seconds carries the sign; d.nanosecondsOfSecond is non-negative).
Implementations§
Source§impl DurationValue
impl DurationValue
Sourcepub fn from_total_nanos(months: i64, days: i64, total_nanos: i64) -> Self
pub fn from_total_nanos(months: i64, days: i64, total_nanos: i64) -> Self
Build from months/days plus a total sub-day nanoseconds count,
FLOOR-splitting it into seconds + non-negative nanos-of-second (the
canonical form: seconds carries the sign, nanos is [0, 1e9)). Used
where a sub-day span is already a bounded total-nanos value (construction,
time-only between, native Arrow durations).
Trait Implementations§
Source§impl Clone for DurationValue
impl Clone for DurationValue
impl Copy for DurationValue
Source§impl Debug for DurationValue
impl Debug for DurationValue
impl Eq for DurationValue
Source§impl PartialEq for DurationValue
impl PartialEq for DurationValue
impl StructuralPartialEq for DurationValue
Auto Trait Implementations§
impl Freeze for DurationValue
impl RefUnwindSafe for DurationValue
impl Send for DurationValue
impl Sync for DurationValue
impl Unpin for DurationValue
impl UnsafeUnpin for DurationValue
impl UnwindSafe for DurationValue
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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