Crate hko

Source
Expand description

This is a library for users to access Hong Kong Observatory Open Data API.

Hong Kong Observatory Open Data API provides weather, earthquake information, and other open data including climate information.

This library provides interfaces to parse JSON-based response from the API, returning Rust data types. To use them, refer the documentation of Mods, Structs, Enums, Functions, as well as Macros.

More details of the API, refer hko.gov.hk (or 中文).

Modules§

common
Common Structs, Enums, and Functions
earthquakeearthquake
Earthquake information
hourly_rainfallhourly_rainfall
Rainfall in the past hour from automatic weather station
lunardatelunardate
Gregorian-Lunar calendar conversion table
opendataopendata
Open Data (Climate and Weather Information)
weatherweather
Weather information

Macros§

impl_display_traits
Implements formatters for multi-language outputs.

Traits§

API
API trait for all data types.
Fetchfetch
Helper trait to fetch data from API.

Functions§

fetchfetch
Helper function to fetch data from API.
fetch_with_clientfetch
Helper function to fetch data from API with custom client.