aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-08-26 23:24:48 -0700
committerPinapelz <yukais@pinapelz.com>2024-08-26 23:24:48 -0700
commita27bb218024b3926b8f700b89ff3104827282bf0 (patch)
treef3be30c8b2f72f33fc8a9fdc5b247f4148b9c225
parent04e2d3d5a88c88bb25edeeef83f37acfd03ba921 (diff)
add docstring for weather_by_time func
-rw-r--r--src/eorzean_weather.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eorzean_weather.rs b/src/eorzean_weather.rs
index 8f79f96..3badd0f 100644
--- a/src/eorzean_weather.rs
+++ b/src/eorzean_weather.rs
@@ -166,6 +166,13 @@ pub fn calculate_weather_forecast_target<T: ToUnixTimestamp>(current_time: T) ->
(step2 % 100) as i32
}
+/// Gets the weather for a given zone at a given time
+///
+/// # Arguments
+/// - `zone_name` - The name of the zone to calculate the forecast for
+///
+/// # Returns
+/// - A Weather struct representing the current weather
pub fn get_weather_by_time<T: ToUnixTimestamp>(zone_name: &str, current_time: T) -> Weather {
// Load the weather data from the JSON file
let weather_data = fs::read_to_string("data/weather_data.json").expect("Unable to read the weather data file");
@@ -201,6 +208,7 @@ pub fn get_weather_by_time<T: ToUnixTimestamp>(zone_name: &str, current_time: T)
}
/// Calculates the weather forecast for a given zone at a given time
+/// Setting interval_offset to 0 will calculate the weather at the given time, as well as the start and end times of the interval
///
/// # Arguments
/// - `zone_name` - The name of the zone to calculate the forecast for
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage