summaryrefslogtreecommitdiff
path: root/src/shared.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared.rs')
-rw-r--r--src/shared.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/shared.rs b/src/shared.rs
index 75a4d1c..43589aa 100644
--- a/src/shared.rs
+++ b/src/shared.rs
@@ -1,6 +1,7 @@
use serde::{Serialize, Deserialize};
-//API answer struct`s
+// API answer struct`s
+/// Main struct with fetched weather data
#[derive(Debug, Serialize, Deserialize)]
pub struct WeatherData {
pub latitude: f64,
@@ -15,18 +16,24 @@ pub struct WeatherData {
pub hourly_units: Option<HourlyUnits>,
pub hourly: Hourly,
}
+
+/// WeatherData.current = ts struct
#[derive(Debug, Serialize, Deserialize)]
pub struct Current {
pub time: String,
pub temperature_2m: f32,
pub wind_speed_10m: f32,
}
+
+/// WeatherData.current_units = ts struct
#[derive(Debug, Serialize, Deserialize)]
pub struct CurrentUnits {
pub time: Option<String>,
pub temperature_2m: Option<String>,
pub wind_speed_10m: Option<String>,
}
+
+/// WeatherData.hourly = ts struct
#[derive(Debug, Serialize, Deserialize)]
pub struct Hourly {
pub time: Vec<String>,
@@ -34,6 +41,8 @@ pub struct Hourly {
pub relative_humidity_2m: Vec<u32>,
pub wind_speed_10m: Vec<f32>,
}
+
+/// WeatherData.hourly_units = ts struct
#[derive(Debug, Serialize, Deserialize)]
pub struct HourlyUnits {
pub time: Option<String>,