Struct okane_core::datamodel::Amount
source · pub struct Amount {
pub value: Decimal,
pub commodity: String,
}Expand description
Amount of posting, balance, …
Fields§
§value: DecimalNumerical value.
commodity: StringCommodity aka currency.
Implementations§
Trait Implementations§
source§impl Neg for Amount
impl Neg for Amount
Examples
let x = okane_core::datamodel::Amount{
value: dec!(-5),
commodity: "JPY".to_string(),
};
let y = -x.clone();
assert_eq!(x.value, dec!(-5));
assert_eq!(x.commodity, "JPY");
assert_eq!(y.value, dec!(5));
assert_eq!(y.commodity, "JPY");source§impl PartialEq for Amount
impl PartialEq for Amount
source§impl PartialOrd for Amount
impl PartialOrd for Amount
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Amount
impl StructuralEq for Amount
impl StructuralPartialEq for Amount
Auto Trait Implementations§
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