Struct currency_layer::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for making requests to Currency Layer
Implementations
sourceimpl Client
impl Client
sourcepub fn new(key: &str) -> Client
pub fn new(key: &str) -> Client
Creates a new client using the provided key for all requests.
Only the free APIs are supported.
sourcepub async fn get_live_rates(
&self,
currencies: Vec<&str>
) -> Result<CurrencyRates<'_>, CurrencyLayerError>
pub async fn get_live_rates(
&self,
currencies: Vec<&str>
) -> Result<CurrencyRates<'_>, CurrencyLayerError>
Get the exchange rates for the provide currencies.
sourcepub async fn get_historical_rates(
&self,
currencies: Vec<&str>,
date: (u16, u16, u16)
) -> Result<CurrencyRates<'_>, CurrencyLayerError>
pub async fn get_historical_rates(
&self,
currencies: Vec<&str>,
date: (u16, u16, u16)
) -> Result<CurrencyRates<'_>, CurrencyLayerError>
Get the exchange rates for the provide currencies on a particular day.
date is a tuple 3 in the format year, month, day.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more