pub struct Money {
pub amount: i32,
pub currency: Currency,
}
Expand description
Represents an amount of money.
Money
fields can be signed or unsigned. Fields that do not explicitly define whether they are
signed or unsigned are considered unsigned and can only hold positive amounts. For signed
fields, the sign of the value indicates the purpose of the money transfer. See
Working with Monetary
Amounts
for more information.
Fields§
§amount: i32
The amount of money, in the smallest denomination of the currency indicated by currency
.
For example, when currency
is USD
, amount
is in cents. Monetary amounts can be
positive or negative. See the specific field description to determine the meaning of the
sign in a particular case.
currency: Currency
The type of currency, in ISO 4217 format. For example, the currency code for US dollars is
USD
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Money
impl<'de> Deserialize<'de> for Money
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Money
impl StructuralPartialEq for Money
Auto Trait Implementations§
impl Freeze for Money
impl RefUnwindSafe for Money
impl Send for Money
impl Sync for Money
impl Unpin for Money
impl UnwindSafe for Money
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.