Make item/sample fields available to the crate

This commit is contained in:
Paul van Tilburg 2022-02-24 20:23:33 +01:00
parent d0ace275ec
commit 1ae6c896dd
Signed by untrusted user: paul
GPG Key ID: C6DE073EDA9EEC4D
3 changed files with 6 additions and 6 deletions

View File

@ -299,13 +299,13 @@ impl MapsRefresh for MapsHandle {
pub(crate) struct Sample {
/// The time(stamp) of the forecast.
#[serde(serialize_with = "ts_seconds::serialize")]
time: DateTime<Utc>,
pub(crate) time: DateTime<Utc>,
/// The forecasted score.
///
/// A value in the range `1..=10`.
#[serde(rename(serialize = "value"))]
score: u8,
pub(crate) score: u8,
}
/// Builds a scoring histogram for the map key.

View File

@ -41,12 +41,12 @@ struct Row {
pub(crate) struct Item {
/// The time(stamp) of the forecast.
#[serde(serialize_with = "ts_seconds::serialize")]
time: DateTime<Utc>,
pub(crate) time: DateTime<Utc>,
/// The forecasted value.
///
/// Its unit is mm/h.
value: f32,
pub(crate) value: f32,
}
impl TryFrom<Row> for Item {

View File

@ -32,12 +32,12 @@ pub(crate) struct Item {
rename(deserialize = "timestamp_measured"),
serialize_with = "ts_seconds::serialize"
)]
time: DateTime<Utc>,
pub(crate) time: DateTime<Utc>,
/// The forecasted value.
///
/// The unit depends on the selected [metric](Metric).
value: f32,
pub(crate) value: f32,
}
/// Retrieves the Luchtmeetnet forecasted items for the provided position and metric.