Struct diesel::pg::data_types::PgInterval [−][src]
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
Methods
impl PgInterval[src]
impl PgIntervalpub fn new(microseconds: i64, days: i32, months: i32) -> Self[src]
pub fn new(microseconds: i64, days: i32, months: i32) -> SelfConstructs 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.
pub fn from_microseconds(microseconds: i64) -> Self[src]
pub fn from_microseconds(microseconds: i64) -> SelfEquivalent to new(microseconds, 0, 0)
pub fn from_days(days: i32) -> Self[src]
pub fn from_days(days: i32) -> SelfEquivalent to new(0, days, 0)
pub fn from_months(months: i32) -> Self[src]
pub fn from_months(months: i32) -> SelfEquivalent to new(0, 0, months)
Trait Implementations
impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgInterval where
__DB: Backend,
Self: FromSql<__ST, __DB>, [src]
impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgInterval where
__DB: Backend,
Self: FromSql<__ST, __DB>, fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>[src]
fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>See the trait documentation.
const FIELDS_NEEDED: usize
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]
impl<__ST, __DB> Queryable<__ST, __DB> for PgInterval where
__DB: Backend,
Self: FromSql<__ST, __DB>, type Row = Self
The Rust type you'd like to map from. Read more
fn build(row: Self::Row) -> Self[src]
fn build(row: Self::Row) -> SelfConstruct an instance of this type
impl<'expr> AsExpression<Interval> for &'expr PgInterval[src]
impl<'expr> AsExpression<Interval> for &'expr PgIntervaltype Expression = Bound<Interval, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl<'expr> AsExpression<Nullable<Interval>> for &'expr PgInterval[src]
impl<'expr> AsExpression<Nullable<Interval>> for &'expr PgIntervaltype Expression = Bound<Nullable<Interval>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl<__DB> ToSql<Nullable<Interval>, __DB> for PgInterval where
__DB: Backend,
Self: ToSql<Interval, __DB>, [src]
impl<__DB> ToSql<Nullable<Interval>, __DB> for PgInterval where
__DB: Backend,
Self: ToSql<Interval, __DB>, impl AsExpression<Interval> for PgInterval[src]
impl AsExpression<Interval> for PgIntervaltype Expression = Bound<Interval, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl AsExpression<Nullable<Interval>> for PgInterval[src]
impl AsExpression<Nullable<Interval>> for PgIntervaltype Expression = Bound<Nullable<Interval>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl Debug for PgInterval[src]
impl Debug for PgIntervalfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for PgInterval[src]
impl Clone for PgIntervalfn clone(&self) -> PgInterval[src]
fn clone(&self) -> PgIntervalReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for PgInterval[src]
impl Copy for PgIntervalimpl PartialEq for PgInterval[src]
impl PartialEq for PgIntervalfn eq(&self, other: &PgInterval) -> bool[src]
fn eq(&self, other: &PgInterval) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &PgInterval) -> bool[src]
fn ne(&self, other: &PgInterval) -> boolThis method tests for !=.
impl Eq for PgInterval[src]
impl Eq for PgIntervalimpl ToSql<Interval, Pg> for PgInterval[src]
impl ToSql<Interval, Pg> for PgIntervalimpl FromSql<Interval, Pg> for PgInterval[src]
impl FromSql<Interval, Pg> for PgIntervalimpl Add<PgInterval> for PgInterval[src]
impl Add<PgInterval> for PgIntervaltype Output = PgInterval
The resulting type after applying the + operator.
fn add(self, other: PgInterval) -> Self::Output[src]
fn add(self, other: PgInterval) -> Self::OutputPerforms the + operation.
Auto Trait Implementations
impl Send for PgInterval
impl Send for PgIntervalimpl Sync for PgInterval
impl Sync for PgInterval