Struct diesel::pg::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 days, 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
[src]
fn from_microseconds(microseconds: i64) -> Self
[src]
fn from_days(days: i32) -> Self
[src]
fn from_months(months: i32) -> Self
[src]
Trait Implementations
impl Debug for PgInterval
[src]
impl Clone for PgInterval
[src]
fn clone(&self) -> PgInterval
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for PgInterval
[src]
impl PartialEq for PgInterval
[src]
fn eq(&self, __arg_0: &PgInterval) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PgInterval) -> bool
[src]
This method tests for !=
.
impl Eq for PgInterval
[src]
impl<DB> FromSqlRow<Interval, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSql<Interval, DB>,
[src]
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSql<Interval, DB>,
fn build_from_row<R: Row<DB>>(
row: &mut R
) -> Result<Self, Box<Error + Send + Sync>>
[src]
row: &mut R
) -> Result<Self, Box<Error + Send + Sync>>
fn fields_needed() -> usize
[src]
The number of fields that this type will consume. Should be equal to the number of times you would call row.take()
in build_from_row
Read more
impl<DB> Queryable<Interval, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSqlRow<Interval, DB>,
[src]
DB: Backend + HasSqlType<Interval>,
PgInterval: FromSqlRow<Interval, DB>,
impl<'a> AsExpression<Interval> for PgInterval
[src]
type Expression = Bound<Interval, Self>
fn as_expression(self) -> Self::Expression
[src]
impl<'a, 'expr> AsExpression<Interval> for &'expr PgInterval
[src]
type Expression = Bound<Interval, Self>
fn as_expression(self) -> Self::Expression
[src]
impl<'a> AsExpression<Nullable<Interval>> for PgInterval
[src]
type Expression = Bound<Nullable<Interval>, Self>
fn as_expression(self) -> Self::Expression
[src]
impl<'a, 'expr> AsExpression<Nullable<Interval>> for &'expr PgInterval
[src]
type Expression = Bound<Nullable<Interval>, Self>
fn as_expression(self) -> Self::Expression
[src]
impl<'a, DB> ToSql<Nullable<Interval>, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: ToSql<Interval, DB>,
[src]
DB: Backend + HasSqlType<Interval>,
PgInterval: ToSql<Interval, DB>,
fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
[src]
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
impl ToSql<Interval, Pg> for PgInterval
[src]
fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, Pg>
) -> Result<IsNull, Box<Error + Send + Sync>>
[src]
&self,
out: &mut ToSqlOutput<W, Pg>
) -> Result<IsNull, Box<Error + Send + Sync>>
impl FromSql<Interval, Pg> for PgInterval
[src]
impl Add<PgInterval> for PgInterval
[src]
type Output = PgInterval
The resulting type after applying the +
operator.
fn add(self, other: PgInterval) -> Self::Output
[src]
Performs the +
operation.