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

[]

The number of whole microseconds

[]

The number of whole days

[]

The number of whole months

Methods

impl PgInterval
[src]
[]

[]

Constructs a new PgInterval

No conversion occurs on the arguments. It is valid to provide a number of microseconds greater than the longest possible day, or a number of days greater than the longest possible month, as it is impossible to say how many months are in "40 days" without knowing a precise date.

[]

Equivalent to new(microseconds, 0, 0)

[]

Equivalent to new(0, days, 0)

[]

Equivalent to new(0, 0, months)

Trait Implementations

impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgInterval where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]
[+]

[]

See the trait documentation.

FIELDS_NEEDED: usize = 1

The number of fields that this type will consume. Must be equal to the number of times you would call row.take() in build_from_row Read more

impl<__ST, __DB> Queryable<__ST, __DB> for PgInterval where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]
[+]

The Rust type you'd like to map from. Read more

[]

Construct an instance of this type

impl<'expr> AsExpression<Interval> for &'expr PgInterval
[src]
[+]

The expression being returned

[]

Perform the conversion

impl<'expr> AsExpression<Nullable<Interval>> for &'expr PgInterval
[src]
[+]

The expression being returned

[]

Perform the conversion

impl<__DB> ToSql<Nullable<Interval>, __DB> for PgInterval where
    __DB: Backend,
    Self: ToSql<Interval, __DB>, 
[src]
[+]

[]

See the trait documentation.

impl AsExpression<Interval> for PgInterval
[src]
[+]

The expression being returned

[]

Perform the conversion

impl AsExpression<Nullable<Interval>> for PgInterval
[src]
[+]

The expression being returned

[]

Perform the conversion

impl Debug for PgInterval
[src]
[+]

[]

Formats the value using the given formatter. Read more

impl Clone for PgInterval
[src]
[+]

[]

Returns a copy of the value. Read more

[]

Performs copy-assignment from source. Read more

impl Copy for PgInterval
[src]

impl PartialEq for PgInterval
[src]
[+]

[]

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

[]

This method tests for !=.

impl Eq for PgInterval
[src]

impl ToSql<Interval, Pg> for PgInterval
[src]
[+]

[]

See the trait documentation.

impl FromSql<Interval, Pg> for PgInterval
[src]
[+]

[]

See the trait documentation.

impl Add<PgInterval> for PgInterval
[src]
[+]

The resulting type after applying the + operator.

[]

Performs the + operation.

Auto Trait Implementations

impl Send for PgInterval

impl Sync for PgInterval