Commit Graph

11 Commits

Author SHA1 Message Date
Paul van Tilburg 014ca5a151
Handle errors on the API side
* The map endpoints return an HTTP 404 error in case of unknown or
  out-of-bound locations
* The forecast endpoint with an address returns an HTTP 404 with error
  JSON in case geocoding fails
* The forecast endpoints return the errors per metric in the `errors`
  field of the forecast
* Implement `Display` for `Metric`
* Use a `BTreeMap` to have an ordered `errors` field/object
* Also log the errors to the console
* Update the tests
* Document the errors that can occur
2022-06-06 16:46:52 +02:00
Paul van Tilburg 7d0cd4a822
Drop pollen and AQI max for PAQI metric
* This was introduced as per #20 but no longer deemed necessary
* Fix up some comments
* Keep the PAQI documentation in `README.md`
2022-06-05 21:47:12 +02:00
Paul van Tilburg 769f0745c8
Update examples with fixes of v0.2.2 taken into account 2022-05-10 15:26:58 +02:00
Paul van Tilburg 5972697cf1
Yield pollen and AQI max for PAQI metric (closes: #20)
* Make the combined provider keep track of the AQI and pollen maximum
  value
* Extend the `Forecast` struct with the `aqi_max` and `pollen_max`
  fields
* Fill the `aqi_max` and `pollen_max` fields when the PAQI metric is
  selected
* Update the documentation
* Extend the tests
2022-05-07 21:43:35 +02:00
Paul van Tilburg 0bf07bd134
Split off all functionality to a library crate
This way we can build Rockets from outside the crate and run benchmarks,
for example.

* Add top-level `setup()` function to create a Rocket and set up the
  maps refresher task
* Change the type of `maps::run` since `!` is still an unstable type
* Fix HTTP code blocks in `README.md` so they don't appear as doctests
  to rustdoc
2022-03-15 09:54:02 +01:00
Paul van Tilburg 4576f8d90a
More textual improvements 2022-03-11 16:35:38 +01:00
Paul van Tilburg 66bd02ea57
Also document the map API endpoint
Because, why not?
2022-03-11 16:18:04 +01:00
Paul van Tilburg 80fd9525c4
Fix missing endpoint in example URLs; tweak text a bit 2022-03-11 16:09:14 +01:00
Paul van Tilburg dc90f57422 Document API response; fix typo 2022-02-25 15:43:15 +01:00
Paul van Tilburg 4db8e4ac03 Add Rocket.toml example file; fix syntax
Also ignore a local `Rocket.toml`; it can be used for development
without comitting it.
2022-02-21 20:54:32 +01:00
Paul van Tilburg 84a434268f
Add README.md and LICENSE file (closes: #6)
Also link the files from the crate and include `README.md` as main crate
documentation.
2022-02-21 17:48:28 +01:00