pub struct ExactCost { /* private fields */ }Expand description
An exact persisted monetary amount.
Implementations§
Source§impl ExactCost
impl ExactCost
Sourcepub const fn new(amount: DecimalAmount, currency: CurrencyCode) -> Self
pub const fn new(amount: DecimalAmount, currency: CurrencyCode) -> Self
Creates a cost denominated in a currency’s major unit.
Sourcepub const fn amount(&self) -> &DecimalAmount
pub const fn amount(&self) -> &DecimalAmount
Returns the exact decimal amount.
Sourcepub const fn currency(&self) -> &CurrencyCode
pub const fn currency(&self) -> &CurrencyCode
Returns the currency code.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ExactCost
impl<'de> Deserialize<'de> for ExactCost
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 ExactCost
impl StructuralPartialEq for ExactCost
Auto Trait Implementations§
impl Freeze for ExactCost
impl RefUnwindSafe for ExactCost
impl Send for ExactCost
impl Sync for ExactCost
impl Unpin for ExactCost
impl UnsafeUnpin for ExactCost
impl UnwindSafe for ExactCost
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