Struct block_tools::db::use_diesel::pg::data_types::Cents [−][src]
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 = PgMoney
The resulting type after applying the +
operator.
pub fn add(self, rhs: PgMoney) -> <PgMoney as Add<PgMoney>>::Output
[src]
Panics
Performs a checked addition, and will panic!
on overflow in both debug
and release
.
impl AddAssign<PgMoney> for PgMoney
[src]
pub 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, &'expr PgMoney>
The expression being returned
pub fn as_expression(
self
) -> <&'expr PgMoney as AsExpression<Money>>::Expression
[src]
self
) -> <&'expr PgMoney as AsExpression<Money>>::Expression
impl AsExpression<Money> for PgMoney
[src]
type Expression = Bound<Money, PgMoney>
The expression being returned
pub fn as_expression(self) -> <PgMoney as AsExpression<Money>>::Expression
[src]
impl AsExpression<Nullable<Money>> for PgMoney
[src]
type Expression = Bound<Nullable<Money>, PgMoney>
The expression being returned
pub fn as_expression(
self
) -> <PgMoney as AsExpression<Nullable<Money>>>::Expression
[src]
self
) -> <PgMoney as AsExpression<Nullable<Money>>>::Expression
impl<'expr> AsExpression<Nullable<Money>> for &'expr PgMoney
[src]
type Expression = Bound<Nullable<Money>, &'expr PgMoney>
The expression being returned
pub fn as_expression(
self
) -> <&'expr PgMoney as AsExpression<Nullable<Money>>>::Expression
[src]
self
) -> <&'expr PgMoney as AsExpression<Nullable<Money>>>::Expression
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]
pub fn from_sql(
bytes: Option<&[u8]>
) -> Result<PgMoney, Box<dyn Error + 'static + Send + Sync, Global>>
[src]
bytes: Option<&[u8]>
) -> Result<PgMoney, Box<dyn Error + 'static + Send + Sync, Global>>
impl<__ST, __DB> FromSqlRow<__ST, __DB> for PgMoney where
__DB: Backend,
PgMoney: FromSql<__ST, __DB>,
[src]
__DB: Backend,
PgMoney: FromSql<__ST, __DB>,
pub fn build_from_row<R>(
row: &mut R
) -> Result<PgMoney, Box<dyn Error + 'static + Send + Sync, Global>> where
R: Row<__DB>,
[src]
row: &mut R
) -> Result<PgMoney, Box<dyn Error + 'static + Send + Sync, Global>> where
R: Row<__DB>,
pub const FIELDS_NEEDED: usize
[src]
impl Ord for PgMoney
[src]
pub fn cmp(&self, other: &PgMoney) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<PgMoney> for PgMoney
[src]
impl PartialOrd<PgMoney> for PgMoney
[src]
pub fn partial_cmp(&self, other: &PgMoney) -> Option<Ordering>
[src]
pub fn lt(&self, other: &PgMoney) -> bool
[src]
pub fn le(&self, other: &PgMoney) -> bool
[src]
pub fn gt(&self, other: &PgMoney) -> bool
[src]
pub fn ge(&self, other: &PgMoney) -> bool
[src]
impl<__ST, __DB> Queryable<__ST, __DB> for PgMoney where
__DB: Backend,
PgMoney: FromSql<__ST, __DB>,
[src]
__DB: Backend,
PgMoney: FromSql<__ST, __DB>,
type Row = PgMoney
The Rust type you'd like to map from. Read more
pub fn build(row: <PgMoney as Queryable<__ST, __DB>>::Row) -> PgMoney
[src]
impl StructuralEq for PgMoney
[src]
impl StructuralPartialEq for PgMoney
[src]
impl Sub<PgMoney> for PgMoney
[src]
type Output = PgMoney
The resulting type after applying the -
operator.
pub fn sub(self, rhs: PgMoney) -> <PgMoney as Sub<PgMoney>>::Output
[src]
Panics
Performs a checked subtraction, and will panic!
on underflow in both debug
and release
.
impl SubAssign<PgMoney> for PgMoney
[src]
pub 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]
pub fn to_sql<W>(
&self,
out: &mut Output<'_, W, Pg>
) -> Result<IsNull, Box<dyn Error + 'static + Send + Sync, Global>> where
W: Write,
[src]
&self,
out: &mut Output<'_, W, Pg>
) -> Result<IsNull, Box<dyn Error + 'static + Send + Sync, Global>> where
W: Write,
impl<__DB> ToSql<Nullable<Money>, __DB> for PgMoney where
__DB: Backend,
PgMoney: ToSql<Money, __DB>,
[src]
__DB: Backend,
PgMoney: ToSql<Money, __DB>,
Auto Trait Implementations
impl RefUnwindSafe for PgMoney
[src]
impl Send for PgMoney
[src]
impl Sync for PgMoney
[src]
impl Unpin for PgMoney
[src]
impl UnwindSafe for PgMoney
[src]
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,
pub 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]
pub fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
Self: AsExpression<T>,
pub fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,