pub struct Interval {
pub months: i32,
pub days: i32,
pub micros: i64,
}Expand description
A PostgreSQL interval: an exact count of months and days plus a
microsecond time component.
Months and days are kept separate because their length depends on the calendar (a month may be 28–31 days) and they cannot be collapsed into a single duration losslessly.
Fields§
§months: i32Number of months.
days: i32Number of days.
micros: i64Number of microseconds.
Implementations§
Trait Implementations§
impl Copy for Interval
impl Eq for Interval
Source§impl FromSql for Interval
impl FromSql for Interval
Source§fn from_sql(_oid: Oid, buf: &[u8]) -> Result<Self, Error>
fn from_sql(_oid: Oid, buf: &[u8]) -> Result<Self, Error>
Decodes a non-null value of type
oid. Read moreSource§fn accepts(oid: Oid) -> bool
fn accepts(oid: Oid) -> bool
Whether this type can be decoded from a column of type
oid. Read moreSource§impl RowShape for Interval
impl RowShape for Interval
Source§const SHAPE: &'static [ColumnSpec]
const SHAPE: &'static [ColumnSpec]
The columns this type expects.
Source§impl StaticType for Interval
impl StaticType for Interval
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more