[−][src]Struct covid19_uk_rs::Request
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 Metric
s 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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,