[][src]Struct diesel::pg::data_types::Cents

pub struct Cents(pub i64);

Money is represented in Postgres as a 64 bit signed integer. This struct is a dumb wrapper type, meant only to indicate the integer's meaning. The fractional precision of the value is determined by the lc_monetary setting of the database. This struct is re-exported as Cents as a convenient and conventional expression of a typical unit of 1/100th of currency. For other names or precisions, users might consider a differently named use of the PgMoney struct.

use diesel::data_types::PgMoney as Pence; // 1/100th unit of Pound
use diesel::data_types::PgMoney as Fils;  // 1/1000th unit of Dinar

Trait Implementations

impl<__ST, __DB> Queryable<__ST, __DB> for PgMoney where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

type Row = Self

The Rust type you'd like to map from. Read more

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

impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgMoney where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

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

type Expression = Bound<Money, Self>

The expression being returned

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

type Expression = Bound<Nullable<Money>, Self>

The expression being returned

impl AsExpression<Money> for PgMoney[src]

type Expression = Bound<Money, Self>

The expression being returned

impl AsExpression<Nullable<Money>> for PgMoney[src]

type Expression = Bound<Nullable<Money>, Self>

The expression being returned

impl<__DB> ToSql<Nullable<Money>, __DB> for PgMoney where
    __DB: Backend,
    Self: ToSql<Money, __DB>, 
[src]

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

impl Eq for PgMoney[src]

impl Clone for PgMoney[src]

impl PartialOrd<PgMoney> for PgMoney[src]

impl PartialEq<PgMoney> for PgMoney[src]

impl Ord for PgMoney[src]

impl Copy for PgMoney[src]

impl Add<PgMoney> for PgMoney[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: PgMoney) -> Self::Output[src]

Panics

Performs a checked addition, and will panic! on overflow in both debug and release.

impl Sub<PgMoney> for PgMoney[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, rhs: PgMoney) -> Self::Output[src]

Panics

Performs a checked subtraction, and will panic! on underflow in both debug and release.

impl AddAssign<PgMoney> for PgMoney[src]

fn add_assign(&mut self, rhs: PgMoney)[src]

Panics

Performs a checked addition, and will panic! on overflow in both debug and release.

impl SubAssign<PgMoney> for PgMoney[src]

fn sub_assign(&mut self, rhs: PgMoney)[src]

Panics

Performs a checked subtraction, and will panic! on underflow in both debug and release.

impl Debug for PgMoney[src]

Auto Trait Implementations

impl Send for PgMoney

impl Unpin for PgMoney

impl Sync for PgMoney

impl UnwindSafe for PgMoney

impl RefUnwindSafe for PgMoney

Blanket Implementations

impl<T> IntoSql for T[src]

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]