pub struct PgInterval {
    pub microseconds: i64,
    pub days: i32,
    pub months: i32,
}
Available on crate feature postgres_backend only.
Expand description

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

The number of whole microseconds

days: i32

The number of whole days

months: i32

The number of whole months

Implementations

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

The resulting type after applying the + operator.

Performs the + operation. Read more

Return an arbitrary value. Read more

Return an iterator of values that are smaller than itself. Read more

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

The expression being returned

Perform the conversion

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

See the trait documentation.

A specialized variant of from_sql for handling null values. Read more

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

This method tests for !=.

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

Construct an instance of this type

See the trait documentation.

See the trait documentation.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

See the trait documentation.

See the trait documentation

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to an expression for Diesel’s query builder. Read more

Convert &self to an expression for Diesel’s query builder. Read more

The number of fields that this type will consume.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.