[−][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<__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 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]
The number of fields that this type will consume. Must be equal to the number of times you would call row.take()
in build_from_row
Read more
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<'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<Money> for PgMoney
[src]
type Expression = Bound<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<__DB> ToSql<Nullable<Money>, __DB> for PgMoney where
__DB: Backend,
Self: ToSql<Money, __DB>,
[src]
__DB: Backend,
Self: ToSql<Money, __DB>,
impl ToSql<Money, Pg> 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 Copy for PgMoney
[src]
impl PartialEq<PgMoney> for PgMoney
[src]
impl Clone for PgMoney
[src]
fn clone(&self) -> PgMoney
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for PgMoney
[src]
fn cmp(&self, other: &PgMoney) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more
impl Eq for PgMoney
[src]
impl Debug 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 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 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
.
Auto Trait Implementations
Blanket Implementations
impl<T> IntoSql for T
[src]
fn into_sql<T>(self) -> AsExprOf<Self, T> where
Self: AsExpression<T> + Sized,
[src]
Self: AsExpression<T> + Sized,
Convert self
to an expression for Diesel's query builder. Read more
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T> where
&'a Self: AsExpression<T>,
[src]
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel's query builder. Read more
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,