pub enum SunriseResult<T = ()> {
RegularDay {
sunrise: T,
transit: T,
sunset: T,
},
AllDay {
transit: T,
},
AllNight {
transit: T,
},
}Expand description
Result of sunrise/sunset calculations for a given day.
Solar events can vary significantly based on location and time of year,
especially at extreme latitudes where polar days and nights occur.
Default generic parameter is chrono::DateTime<chrono::Utc> when std feature is enabled.
Variants§
RegularDay
Regular day with distinct sunrise, transit (noon), and sunset times
Fields
sunrise: TTime of sunrise
transit: TTime of solar transit (when sun crosses meridian, solar noon)
sunset: TTime of sunset
AllDay
Polar day - sun remains above the specified horizon all day
Fields
transit: TTime of solar transit (closest approach to zenith)
AllNight
Polar night - sun remains below the specified horizon all day
Fields
transit: TTime of solar transit (when sun is highest, though still below horizon)
Implementations§
Source§impl<T> SunriseResult<T>
impl<T> SunriseResult<T>
Sourcepub const fn is_regular_day(&self) -> bool
pub const fn is_regular_day(&self) -> bool
Checks if this represents a regular day with sunrise and sunset.
Sourcepub const fn is_polar_day(&self) -> bool
pub const fn is_polar_day(&self) -> bool
Checks if this represents a polar day (sun never sets).
Sourcepub const fn is_polar_night(&self) -> bool
pub const fn is_polar_night(&self) -> bool
Checks if this represents a polar night (sun never rises).
Trait Implementations§
Source§impl<T: Clone> Clone for SunriseResult<T>
impl<T: Clone> Clone for SunriseResult<T>
Source§fn clone(&self) -> SunriseResult<T>
fn clone(&self) -> SunriseResult<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more