pub struct IADB;Implementations§
Source§impl IADB
impl IADB
Sourcepub async fn get_data(
series_code: &String,
date_from: &String,
date_to: &String,
) -> Result<IADBSeries, Box<dyn Error>>
pub async fn get_data( series_code: &String, date_from: &String, date_to: &String, ) -> Result<IADBSeries, Box<dyn Error>>
Makes an API request to the IADB and deserializes the response into a time series.
§Input
series_code: Code of the time series in the IADB.date_from: Date from which the data will be extracted (Note: Date format is%d/%b/%Y)date_from: Date up to which the data will be extracted (Note: Date format is%d/%b/%Y)
§Examples
use iadb_api::{schemas::IADBSeries, backend::IADB};
#[tokio::main]
async fn main() -> () {
// Parameters
let series_code: String = SeriesCode::IUDSOIA.to_string();
let date_from: String = String::from("01/Jan/2000");
let date_to: String = String::from("01/Oct/2018");
// Data collection
let data: IADBSeries = IADB::get_data(&series_code, &date_from, &date_to).await.unwrap();
println!("{}", data);
}Auto Trait Implementations§
impl Freeze for IADB
impl RefUnwindSafe for IADB
impl Send for IADB
impl Sync for IADB
impl Unpin for IADB
impl UnwindSafe for IADB
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