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
Implementations
impl PgInterval
[src]
pub fn new(microseconds: i64, days: i32, months: i32) -> Self
[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.
pub fn from_microseconds(microseconds: i64) -> Self
[src]
Equivalent to new(microseconds, 0, 0)
pub fn from_days(days: i32) -> Self
[src]
Equivalent to new(0, days, 0)
pub fn from_months(months: i32) -> Self
[src]
Equivalent to new(0, 0, months)
Trait Implementations
impl Add<PgInterval> for PgInterval
[src]
type Output = PgInterval
The resulting type after applying the +
operator.
fn add(self, other: PgInterval) -> Self::Output
[src]
impl<'expr> AsExpression<Interval> for &'expr PgInterval
[src]
type Expression = Bound<Interval, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl AsExpression<Interval> for PgInterval
[src]
type Expression = Bound<Interval, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<'expr> AsExpression<Nullable<Interval>> for &'expr PgInterval
[src]
type Expression = Bound<Nullable<Interval>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl AsExpression<Nullable<Interval>> for PgInterval
[src]
type Expression = Bound<Nullable<Interval>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl Clone for PgInterval
[src]
fn clone(&self) -> PgInterval
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PgInterval
[src]
impl Debug for PgInterval
[src]
impl Eq for PgInterval
[src]
impl FromSql<Interval, Pg> for PgInterval
[src]
impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgInterval where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
[src]
const FIELDS_NEEDED: usize
[src]
impl PartialEq<PgInterval> for PgInterval
[src]
fn eq(&self, other: &PgInterval) -> bool
[src]
fn ne(&self, other: &PgInterval) -> bool
[src]
impl<__ST, __DB> Queryable<__ST, __DB> for PgInterval where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__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]
impl StructuralEq for PgInterval
[src]
impl StructuralPartialEq for PgInterval
[src]
impl ToSql<Interval, Pg> for PgInterval
[src]
impl<__DB> ToSql<Nullable<Interval>, __DB> for PgInterval where
__DB: Backend,
Self: ToSql<Interval, __DB>,
[src]
__DB: Backend,
Self: ToSql<Interval, __DB>,
Auto Trait Implementations
impl RefUnwindSafe for PgInterval
impl Send for PgInterval
impl Sync for PgInterval
impl Unpin for PgInterval
impl UnwindSafe for PgInterval
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
Self: AsExpression<T> + Sized,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,