pub struct Currencyapi { /* private fields */ }Expand description
The main struct of the crate giving access to the currencyapi. Create a new instance of the struct with your api key as parameter.
Implementations§
Source§impl<'a> Currencyapi
impl<'a> Currencyapi
Sourcepub fn new(api_key: &'a str) -> Result<Self, CurrencyapiError>
pub fn new(api_key: &'a str) -> Result<Self, CurrencyapiError>
Creates a new instance of the Currencyapi struct by passing your api key as function parameter.
pub async fn status(&self) -> Result<DetailsResponse, CurrencyapiError>
pub async fn currencies(&self) -> Result<DetailsResponse, CurrencyapiError>
pub async fn latest( &self, base_currency: &'a str, currencies: &'a str, ) -> Result<DetailsResponse, CurrencyapiError>
pub async fn historical( &self, base_currency: &'a str, date: &'a str, currencies: &'a str, ) -> Result<DetailsResponse, CurrencyapiError>
pub async fn convert( &self, base_currency: &'a str, date: &'a str, value: i8, currencies: &'a str, ) -> Result<DetailsResponse, CurrencyapiError>
pub async fn range( &self, base_currency: &'a str, datetime_start: &'a str, datetime_end: &'a str, currencies: &'a str, accuracy: &'a str, ) -> Result<DetailsResponse, CurrencyapiError>
Trait Implementations§
Source§impl Clone for Currencyapi
impl Clone for Currencyapi
Source§fn clone(&self) -> Currencyapi
fn clone(&self) -> Currencyapi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Currencyapi
impl !RefUnwindSafe for Currencyapi
impl Send for Currencyapi
impl Sync for Currencyapi
impl Unpin for Currencyapi
impl !UnwindSafe for Currencyapi
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