[][src]Crate covid19_uk_rs

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 => {},
    }
}

Structs

Filter
Request

A request to the API.

Enums

AreaType
Error
FilterValue

Valid filter types and their associated value for specific data requests

Metric

Valid metrics which may be requested from the NHS API.

Type Definitions

Data

The complete collection of days.

Datum

The data for the requested metrics for a specific day.