Struct finql_data::cash_flow::CashAmount[][src]

pub struct CashAmount {
    pub amount: f64,
    pub currency: Currency,
}

Container for an amount of money in some currency

Fields

amount: f64currency: Currency

Implementations

impl CashAmount[src]

pub async fn add(
    &mut self,
    cash_amount: CashAmount,
    time: DateTime<Utc>,
    currency_converter: &mut dyn CurrencyConverter,
    with_rounding: bool
) -> Result<&mut Self, CurrencyError>
[src]

pub async fn add_opt(
    &mut self,
    cash_amount: Option<CashAmount>,
    time: DateTime<Utc>,
    currency_converter: &mut dyn CurrencyConverter,
    with_rounding: bool
) -> Result<&mut Self, CurrencyError>
[src]

pub async fn sub(
    &mut self,
    cash_amount: CashAmount,
    time: DateTime<Utc>,
    currency_converter: &mut dyn CurrencyConverter,
    with_rounding: bool
) -> Result<&mut Self, CurrencyError>
[src]

pub async fn sub_opt(
    &mut self,
    cash_amount: Option<CashAmount>,
    time: DateTime<Utc>,
    currency_converter: &mut dyn CurrencyConverter,
    with_rounding: bool
) -> Result<&mut Self, CurrencyError>
[src]

pub fn round(&self, digits: i32) -> CashAmount[src]

Round a cash amount to that number of decimals

pub fn round_by_convention(
    &self,
    rounding_conventions: &BTreeMap<String, i32>
) -> CashAmount
[src]

Round Cash amount according to rounding conventions Lookup currency in rounding_conventions. If found, use the number of digits found for rounding to that number of decimals, otherwise round to two decimals.

Trait Implementations

impl Clone for CashAmount[src]

impl Copy for CashAmount[src]

impl Debug for CashAmount[src]

impl<'de> Deserialize<'de> for CashAmount[src]

impl Display for CashAmount[src]

impl Neg for CashAmount[src]

type Output = CashAmount

The resulting type after applying the - operator.

impl PartialEq<CashAmount> for CashAmount[src]

impl Serialize for CashAmount[src]

impl StructuralPartialEq for CashAmount[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.