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(123456), }; let inserted_item = insert(&new_item).into(items) .get_result::<Item>(&connection).unwrap(); assert_eq!(Cents(123456), inserted_item.price);
Trait Implementations
impl QueryId for Money
[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