covid19_uk_rs 1.0.1

Unofficial Rust library for the 'Coronavirus in the UK' data API
Documentation

This library is not affiliated with the NHS, Public Health England, or the UK Government. This is an unofficial project to provide Rust bindings for the NHS COVID-19 API.

This library provides interfaces with the NHS 'Coronavirus (COVID-19) in the UK' data APIs, provided by gov.uk.

Examples

use covid19_uk_rs;

let mut req = covid19_uk_rs::Request::new(covid19_uk_rs::AreaType::Nation, covid19_uk_rs::Metric::CumulativeCasesByPublishDate(0));
req.add_filter(covid19_uk_rs::Filter::new(covid19_uk_rs::FilterValue::AreaName(String::from("england"))));

for day in req.get().unwrap() {
match day.get(0) {
Some(i) => match i {
covid19_uk_rs::Metric::CumulativeCasesByPublishDate(i) => println!("{}", i),
_ => {},
},
None => {},
}
}