pub trait ExchangeRateFn {
// Required method
fn relative_to_base_currency(
&self,
currency: &str,
) -> Result<f64, Box<dyn Error + Send + Sync + 'static>>;
}👎Deprecated: Use
ExchangeRateFnV2 insteadExpand description
An exchange rate handler.
Required Methods§
Sourcefn relative_to_base_currency(
&self,
currency: &str,
) -> Result<f64, Box<dyn Error + Send + Sync + 'static>>
👎Deprecated: Use ExchangeRateFnV2::relative_to_base_currency instead
fn relative_to_base_currency( &self, currency: &str, ) -> Result<f64, Box<dyn Error + Send + Sync + 'static>>
ExchangeRateFnV2::relative_to_base_currency insteadReturns the value of a currency relative to the base currency. The base currency depends on your implementation. fend-core can work with any base currency as long as it is consistent.
§Errors
This function errors out if the currency was not found or the conversion is impossible for any reason (HTTP request failed, etc.)