pub struct Amount {
pub quantity: Quantity,
/* private fields */
}
Fields§
§quantity: Quantity
Implementations§
Source§impl Amount
impl Amount
pub fn new(quantity: Quantity, commodity: Option<*const Commodity>) -> Self
pub fn copy_from(other: &Amount) -> Self
pub fn null() -> Self
pub fn add(&mut self, other: &Amount)
pub fn get_commodity(&self) -> Option<&Commodity>
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Indicates whether the amount is initialized. This is a 0 quantity and no Commodity.
pub fn is_zero(&self) -> bool
pub fn remove_commodity(&mut self)
Trait Implementations§
Source§impl AddAssign for Amount
impl AddAssign for Amount
Source§fn add_assign(&mut self, other: Amount)
fn add_assign(&mut self, other: Amount)
Performs the
+=
operation. Read moreSource§impl MulAssign for Amount
impl MulAssign for Amount
Source§fn mul_assign(&mut self, rhs: Amount)
fn mul_assign(&mut self, rhs: Amount)
Performs the
*=
operation. Read moreSource§impl SubAssign for Amount
impl SubAssign for Amount
Source§fn sub_assign(&mut self, other: Amount)
fn sub_assign(&mut self, other: Amount)
Performs the
-=
operation. Read moreimpl Copy for Amount
impl Eq for Amount
impl StructuralPartialEq for Amount
Auto Trait Implementations§
impl Freeze for Amount
impl RefUnwindSafe for Amount
impl !Send for Amount
impl !Sync for Amount
impl Unpin for Amount
impl UnwindSafe for Amount
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.