pub struct Money(/* private fields */);Implementations§
Source§impl Money
impl Money
pub const ZERO: Self
pub const fn new(int: i64, fract: u8) -> Self
Sourcepub const fn new_subunit(value: f64) -> Self
pub const fn new_subunit(value: f64) -> Self
From a subunit amount (öre, cents etc) E.g. Money::new_subunit(8.86) -> Money(8860)
pub const fn display(&self, currency: Currency) -> MoneyDisplay
pub const fn inner(&self) -> i64
pub const fn from_inner(inner: i64) -> Self
pub const fn from_f64(value: f64) -> Self
pub const fn to_f64(self) -> f64
pub const fn divide_by(&self, by: i64) -> Self
Trait Implementations§
Source§impl Ord for Money
impl Ord for Money
Source§impl PartialOrd for Money
impl PartialOrd for Money
impl Copy for Money
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.