unitx-core 0.1.0

Fast unit conversion primitives with live currency rates.
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::currency::CurrencyUnit;
use rust_decimal::Decimal;

pub mod live;

pub use live::LiveExchangeProvider;

pub trait ExchangeRateProvider {
    fn get_rate(&self, from: CurrencyUnit, to: CurrencyUnit) -> Result<Decimal, String>;
}