libtad_models/astronomy/
astronomy_day.rs

1use super::{AstronomyDayEvent, MoonPhase};
2use crate::time::DateTime;
3use serde::Deserialize;
4
5#[derive(Debug, Deserialize)]
6/// Information about an astronomical object for a specific day.
7pub struct AstronomyDay {
8    #[serde(deserialize_with = "DateTime::deserialize_from_str", default)]
9    /// Date for the current information.
10    pub date: DateTime,
11
12    /// Length of this day (time between sunrise and sunset). If the sun is not up on this day,
13    /// 00:00:00 will be reported. If the sun does not set on this day, the value will read
14    /// 24:00:00. Attribute only applies for the sun object and if requested.
15    pub daylength: Option<String>,
16
17    /// Moon phase for the day. Only if requested.
18    pub moonphase: Option<MoonPhase>,
19
20    /// Lists all events during the day.
21    pub events: Vec<AstronomyDayEvent>,
22}