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