Struct diesel::data_types::PgInterval [] [src]

pub struct PgInterval {
    pub microseconds: i64,
    pub days: i32,
    pub months: i32,
}

Intervals in Postgres are separated into 3 parts. A 64 bit integer representing time in microseconds, a 32 bit integer representing number of minutes, and a 32 bit integer representing number of months. This struct is a dumb wrapper type, meant only to indicate the meaning of these parts.

Fields

microseconds: i64 days: i32 months: i32

Methods

impl PgInterval
[src]

fn new(microseconds: i64, days: i32, months: i32) -> Self

fn from_microseconds(microseconds: i64) -> Self

fn from_days(days: i32) -> Self

fn from_months(months: i32) -> Self

Trait Implementations

impl Eq for PgInterval
[src]

impl PartialEq for PgInterval
[src]

fn eq(&self, __arg_0: &PgInterval) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &PgInterval) -> bool

This method tests for !=.

impl Copy for PgInterval
[src]

impl Clone for PgInterval
[src]

fn clone(&self) -> PgInterval

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for PgInterval
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Queriable<Interval> for PgInterval
[src]

type Row = Self

fn build(row: Self::Row) -> Self

impl<'a> AsExpression<Interval> for PgInterval
[src]

type Expression = Bound<Interval, Self>

fn as_expression(self) -> Self::Expression

impl<'a: 'expr, 'expr> AsExpression<Interval> for &'expr PgInterval
[src]

type Expression = Bound<Interval, Self>

fn as_expression(self) -> Self::Expression

impl<'a> AsExpression<Nullable<Interval>> for PgInterval
[src]

type Expression = Bound<Nullable<Interval>, Self>

fn as_expression(self) -> Self::Expression

impl<'a: 'expr, 'expr> AsExpression<Nullable<Interval>> for &'a PgInterval
[src]

type Expression = Bound<Nullable<Interval>, Self>

fn as_expression(self) -> Self::Expression

impl<'a> ToSql<Nullable<Interval>> for PgInterval
[src]

fn to_sql<W: Write>(&self, out: &mut W) -> Result<IsNullBox<Error>>

impl ToSql<Interval> for PgInterval
[src]

fn to_sql<W: Write>(&self, out: &mut W) -> Result<IsNullBox<Error>>

impl FromSql<Interval> for PgInterval
[src]

fn from_sql(bytes: Option<&[u8]>) -> Result<Self, Box<Error>>

impl Add<PgInterval> for PgInterval
[src]

type Output = PgInterval

The resulting type after applying the + operator

fn add(self, other: PgInterval) -> Self::Output

The method for the + operator