pub struct Fxapi { /* private fields */ }
Expand description
The main struct of the crate giving access to the fxapi. Create a new instance of the struct with your api key as parameter.
Implementations§
Source§impl<'a> Fxapi
impl<'a> Fxapi
Sourcepub fn new(api_key: &'a str) -> Result<Self, FxapiError>
pub fn new(api_key: &'a str) -> Result<Self, FxapiError>
Creates a new instance of the Fxapi struct by passing your api key as function parameter.
pub async fn status(&self) -> Result<DetailsResponse, FxapiError>
pub async fn currencies(&self) -> Result<DetailsResponse, FxapiError>
pub async fn latest( &self, base_currency: &'a str, currencies: &'a str, ) -> Result<DetailsResponse, FxapiError>
pub async fn historical( &self, base_currency: &'a str, date: &'a str, currencies: &'a str, ) -> Result<DetailsResponse, FxapiError>
pub async fn convert( &self, base_currency: &'a str, date: &'a str, value: i8, currencies: &'a str, ) -> Result<DetailsResponse, FxapiError>
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, FxapiError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fxapi
impl !RefUnwindSafe for Fxapi
impl Send for Fxapi
impl Sync for Fxapi
impl Unpin for Fxapi
impl !UnwindSafe for Fxapi
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