[−][src]Function rparif::indice
pub fn indice(api_key: &str) -> Result<Vec<Index>, RParifError>
Convenient function that allow easy to access indice
endpoint.
If multiple calls needs to be made to HTTP API, use RParifClient
Arguments
api_key
- API key
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::UnexpectedDate if the date can't be parsed (see
convert_json_to_date
) -
RParifError::MissingJsonKey if missing JSON is missing
indice
pollution -
RParifError::WrongJsonType if
indice
pollution is not a number or if JSON is not as expected -
RParifError::JsonError if response isn't a well formed JSON