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; #[derive(Queryable)] struct Item { id: i32, name: String, price: Cents, } #[derive(Insertable)] #[table_name="items"] struct NewItem { name: String, price: Cents, } table! { items { id -> Integer, name -> VarChar, price -> Money, } } let new_item = NewItem { name: "Shiny Thing".into(), price: Cents(123_456), }; let inserted_item = insert_into(items).values(&new_item) .get_result::<Item>(&connection).unwrap(); assert_eq!(Cents(123_456), inserted_item.price);
Trait Implementations
impl QueryId for Money
[src]
type QueryId = Self
const HAS_STATIC_QUERY_ID: bool
HAS_STATIC_QUERY_ID: bool = true
fn query_id() -> Option<TypeId>
[src]
impl NotNull for Money
[src]
impl SingleValue for Money
[src]
impl Debug for Money
[src]
impl Clone for Money
[src]
fn clone(&self) -> Money
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more