[−][src]Function rparif::indice_day
pub fn indice_day(api_key: &str, day: Day) -> Result<Vec<Index>, RParifError>
Convenient function that allow easy to access indiceJour
endpoint.
If multiple calls needs to be made to HTTP API, use RParifClient
Arguments
-
api_key
- API key -
day
- Which day to get pollution indices for
Errors
-
RParifError::RequestError when reqwest lib fails. It contains the underlying error.
-
RParifError::CallError when HTTP status is other than 2XX. It contains the URL called, the HTTP status and the body response
-
RParifError::MissingJsonKey if missing JSON is missing
indice
pollution ordate
-
RParifError::WrongJsonType if
indice
pollution is not a number or ifdate
isn't a string -
RParifError::DateParseError if
date
is not indd/mm/yyyy
format -
RParifError::JsonError if response isn't a well formed JSON