summaryrefslogtreecommitdiff
path: root/src/shared.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-11-18 21:24:04 +0300
committerNamilskyy <alive6863@gmail.com>2025-11-18 22:03:57 +0300
commit0e3574d26990e93b5a66af2426cb2102b2ba0a5f (patch)
treef28a5b0e8520e62e3d5bfcc8a2651e73fbf4cd89 /src/shared.rs
parentb417227555dded641b03e9583e4b3f893b5d2e83 (diff)
Fixed all warnings, added minimal design.
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>,