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 PgMoney
type Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
fn as_expression(self) -> Self::Expression
Perform the conversion
impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoney
[src]
impl<'expr2, 'expr> AsExpression<Money> for &'expr2 &'expr PgMoney
type Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
fn as_expression(self) -> Self::Expression
Perform the conversion
impl AsExpression<Money> for PgMoney
[src]
impl AsExpression<Money> for PgMoney
type Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
fn as_expression(self) -> Self::Expression
Perform the conversion
impl FromSql<Money, Pg> for PgMoney
[src]
impl FromSql<Money, Pg> for PgMoney
impl ToSql<Money, Pg> for PgMoney
[src]
impl ToSql<Money, Pg> for PgMoney
impl QueryId for Money
[src]
impl QueryId for Money
type 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 Money
impl SingleValue for Money
[src]
impl SingleValue for Money
impl HasSqlType<Money> for Pg
[src]
impl HasSqlType<Money> for Pg
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
[src]
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
Fetch the metadata for the given type Read more
impl Debug for Money
[src]
impl Debug for Money
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Money
[src]
impl Clone for Money
fn clone(&self) -> Money
[src]
fn clone(&self) -> Money
Returns 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 Money
impl Default for Money
[src]
impl Default for Money