[][src]Struct diesel::pg::types::sql_types::Money

pub struct Money;

The PostgreSQL Money type.

ToSql impls

FromSql impls

Examples

use diesel::data_types::Cents;

table! {
    items {
        id -> Integer,
        name -> VarChar,
        price -> Money,
    }
}

let inserted_price = insert_into(items)
    .values((name.eq("Shiny Thing"), price.eq(Cents(123_456))))
    .returning(price)
    .get_result(&connection);
assert_eq!(Ok(Cents(123_456)), inserted_price);

Trait Implementations

impl FromSql<Money, Pg> for PgMoney[src]

impl<'expr> AsExpression<Money> for &'expr PgMoney[src]

type Expression = Bound<Money, Self>

The expression being returned

impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoney[src]

type Expression = Bound<Money, Self>

The expression being returned

impl AsExpression<Money> for PgMoney[src]

type Expression = Bound<Money, Self>

The expression being returned

impl QueryId for Money[src]

type QueryId = Money

A type which uniquely represents Self in a SQL query. Read more

impl ToSql<Money, Pg> for PgMoney[src]

impl HasSqlType<Money> for Pg[src]

impl NotNull for Money[src]

impl SingleValue for Money[src]

impl Default for Money[src]

impl Clone for Money[src]

impl Copy for Money[src]

impl Debug for Money[src]

Auto Trait Implementations

impl Send for Money

impl Unpin for Money

impl Sync for Money

impl UnwindSafe for Money

impl RefUnwindSafe for Money

Blanket Implementations

impl<T> IntoSql for T[src]

impl<T> IntoNullable for T where
    T: NotNull
[src]

type Nullable = Nullable<T>

The nullable representation of this type. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]