[][src]Struct covid19_uk_rs::Request

pub struct Request { /* fields omitted */ }

A request to the API.

A request is constructed and then submitted to the API. The request may be re-used and modified, if desired, but filters and metrics cannot be removed.

When a request is executed using get or get_latest_by_metric, a Data object is returned, which is a vector of Datum elements (these being vectors of Metric elements). Each Datum represents a specific day's data, with the encompassed Metrics storing the result data. The days are returned in the order the API provides (reverse-chronological).

Implementations

impl Request[src]

pub fn new(area_type: AreaType, metric: Metric) -> Request[src]

pub fn add_filter(&mut self, filter: Filter)[src]

pub fn add_metric(&mut self, metric: Metric)[src]

pub fn get(&self) -> Result<Data, Error>[src]

pub fn get_latest_by_metric(&self, metric: Metric) -> Result<Data, Error>[src]

Trait Implementations

impl Debug for Request[src]

Auto Trait Implementations

impl RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl UnwindSafe for Request

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.