pub struct Prices {
pub rates: HashMap<CommoditiesPair, RatesTable>,
}Fields§
§rates: HashMap<CommoditiesPair, RatesTable>Implementations§
Source§impl Prices
impl Prices
pub fn new() -> Self
pub fn insert_from(&mut self, ledger: &Ledger)
pub fn convert( &self, amount: Decimal, src_commodity_name: &str, dst_commodity_name: &str, date: NaiveDate, ) -> Result<Decimal, PricesError>
pub fn get_rate( &self, src_commodity_name: &str, dst_commodity_name: &str, date: NaiveDate, ) -> Result<Decimal, PricesError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prices
impl RefUnwindSafe for Prices
impl Send for Prices
impl Sync for Prices
impl Unpin for Prices
impl UnwindSafe for Prices
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