Struct diesel::pg::types::sql_types::Money [−][src]
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<'expr> AsExpression<Money> for &'expr PgMoney[src]
impl<'expr> AsExpression<Money> for &'expr PgMoneytype Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoney[src]
impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoneytype Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl AsExpression<Money> for PgMoney[src]
impl AsExpression<Money> for PgMoneytype Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression[src]
fn as_expression(self) -> Self::ExpressionPerform the conversion
impl FromSql<Money, Pg> for PgMoney[src]
impl FromSql<Money, Pg> for PgMoneyimpl ToSql<Money, Pg> for PgMoney[src]
impl ToSql<Money, Pg> for PgMoneyimpl QueryId for Money[src]
impl QueryId for Moneytype QueryId = Money
A type which uniquely represents Self in a SQL query. Read more
const HAS_STATIC_QUERY_ID: bool
HAS_STATIC_QUERY_ID: bool = true
Can the SQL generated by Self be uniquely identified by its type? Read more
fn query_id() -> Option<TypeId>[src]
fn query_id() -> Option<TypeId>Returns the type id of Self::QueryId if Self::HAS_STATIC_QUERY_ID. Returns None otherwise. Read more
impl NotNull for Money[src]
impl NotNull for Moneyimpl SingleValue for Money[src]
impl SingleValue for Moneyimpl HasSqlType<Money> for Pg[src]
impl HasSqlType<Money> for Pgfn metadata(_: &PgMetadataLookup) -> PgTypeMetadata[src]
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadataFetch the metadata for the given type Read more
impl Debug for Money[src]
impl Debug for Moneyfn 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 Money[src]
impl Clone for Moneyfn clone(&self) -> Money[src]
fn clone(&self) -> MoneyReturns 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)1.0.0
[src]Performs copy-assignment from source. Read more
impl Copy for Money[src]
impl Copy for Moneyimpl Default for Money[src]
impl Default for Money