[−][src]Struct diesel::pg::data_types::Cents
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 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 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<'expr> AsExpression<Money> for &'expr PgMoney
[src]
type Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl AsExpression<Money> for PgMoney
[src]
type Expression = Bound<Money, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl<'expr> AsExpression<Nullable<Money>> for &'expr PgMoney
[src]
type Expression = Bound<Nullable<Money>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl AsExpression<Nullable<Money>> for PgMoney
[src]
type Expression = Bound<Nullable<Money>, Self>
The expression being returned
fn as_expression(self) -> Self::Expression
[src]
impl Clone for PgMoney
[src]
impl Copy for PgMoney
[src]
impl Debug for PgMoney
[src]
impl Eq for PgMoney
[src]
impl FromSql<Money, Pg> for PgMoney
[src]
impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgMoney where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
fn build_from_row<R: Row<__DB>>(row: &mut R) -> Result<Self>
[src]
const FIELDS_NEEDED: usize
[src]
impl Ord for PgMoney
[src]
fn cmp(&self, other: &PgMoney) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PgMoney> for PgMoney
[src]
impl PartialOrd<PgMoney> for PgMoney
[src]
fn partial_cmp(&self, other: &PgMoney) -> Option<Ordering>
[src]
fn lt(&self, other: &PgMoney) -> bool
[src]
fn le(&self, other: &PgMoney) -> bool
[src]
fn gt(&self, other: &PgMoney) -> bool
[src]
fn ge(&self, other: &PgMoney) -> bool
[src]
impl<__ST, __DB> Queryable<__ST, __DB> for PgMoney where
__DB: Backend,
Self: FromSql<__ST, __DB>,
[src]
__DB: Backend,
Self: FromSql<__ST, __DB>,
type Row = Self
The Rust type you'd like to map from. Read more
fn build(row: Self::Row) -> Self
[src]
impl StructuralEq for PgMoney
[src]
impl StructuralPartialEq for PgMoney
[src]
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 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 ToSql<Money, Pg> for PgMoney
[src]
impl<__DB> ToSql<Nullable<Money>, __DB> for PgMoney where
__DB: Backend,
Self: ToSql<Money, __DB>,
[src]
__DB: Backend,
Self: ToSql<Money, __DB>,
Auto Trait Implementations
impl RefUnwindSafe for PgMoney
impl Send for PgMoney
impl Sync for PgMoney
impl Unpin for PgMoney
impl UnwindSafe for PgMoney
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
Self: AsExpression<T> + Sized,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,