Expand description
This crate provides functionality for storing and exchanging various ISO-4217 currency codes using the European Central Bank.
§Features
num-traits
adds support for the num-traits crate.serde
adds support for the serde crate.
§Re-exports
rust_decimal::Decimal
, because it is required to createMoney
.
Structs§
- Decimal
Decimal
represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimal
are of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.- Exchange
Rates - A collection of rates of exchange between currencies such that some
amount
ofMoney
divided by itsCurrency
will yieldCurrency::Eur
, and anamount
ofCurrency::Eur
multiplied by anyCurrency
’s exchange rate will yield thatCurrency
. - Money
- An
amount
ofCurrency
.
Enums§
- Currency
- ISO-4217 currency codes which are reported by the European Central Bank for exchange.
- Error
- An
Error
for the crate.
Traits§
- Exchange
- Implementors of this trait contain quantities which are relative to the
Currency
they are currently in. To view them in anotherCurrency
, they must be exchanged using the rates of conversion.