pub struct PgInterval {
pub months: i32,
pub days: i32,
pub micros: i64,
}Expand description
A Postgres interval: months, days and microseconds kept apart, as the
server stores them.
Fields§
§months: i32§days: i32§micros: i64Implementations§
Source§impl PgInterval
impl PgInterval
Sourcepub fn to_iso8601(&self) -> String
pub fn to_iso8601(&self) -> String
ISO 8601 as Postgres’s iso_8601 interval style prints it: each
component carries its own sign, and a zero interval is PT0S.
Trait Implementations§
Source§impl Clone for PgInterval
impl Clone for PgInterval
impl Copy for PgInterval
Source§impl Debug for PgInterval
impl Debug for PgInterval
impl Eq for PgInterval
Source§impl<'a> FromSql<'a> for PgInterval
impl<'a> FromSql<'a> for PgInterval
Source§fn from_sql(
_: &Type,
raw: &'a [u8],
) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql( _: &Type, raw: &'a [u8], ) -> Result<Self, Box<dyn Error + Sync + Send>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type in its binary format. Read moreSource§fn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type.Source§impl PartialEq for PgInterval
impl PartialEq for PgInterval
impl StructuralPartialEq for PgInterval
Auto Trait Implementations§
impl Forget for PgInterval
impl Freeze for PgInterval
impl Move for PgInterval
impl RefUnwindSafe for PgInterval
impl Send for PgInterval
impl Sync for PgInterval
impl Unpin for PgInterval
impl UnsafeUnpin for PgInterval
impl UnwindSafe for PgInterval
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