pub struct Money { /* private fields */ }Expand description
Money represented in minor units.
Implementations§
Source§impl Money
impl Money
Sourcepub fn new_minor(
amount: i64,
currency: impl AsRef<str>,
) -> Result<Self, PaymentError>
pub fn new_minor( amount: i64, currency: impl AsRef<str>, ) -> Result<Self, PaymentError>
Creates money from a minor-unit amount and currency code.
§Errors
Returns an error when either component is invalid.
Sourcepub const fn amount(&self) -> MinorAmount
pub const fn amount(&self) -> MinorAmount
Returns the amount.
Sourcepub const fn currency(&self) -> &CurrencyCode
pub const fn currency(&self) -> &CurrencyCode
Returns the currency.
Trait Implementations§
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 UnsafeUnpin 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