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 helpers return SunriseResult<chrono::DateTime<Tz>>.
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for SunriseResult<T>
impl<T: Debug> Debug for SunriseResult<T>
Source§impl<T: PartialEq> PartialEq for SunriseResult<T>
impl<T: PartialEq> PartialEq for SunriseResult<T>
impl<T: Eq> Eq for SunriseResult<T>
impl<T> StructuralPartialEq for SunriseResult<T>
Auto Trait Implementations§
impl<T> Freeze for SunriseResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for SunriseResult<T>where
T: RefUnwindSafe,
impl<T> Send for SunriseResult<T>where
T: Send,
impl<T> Sync for SunriseResult<T>where
T: Sync,
impl<T> Unpin for SunriseResult<T>where
T: Unpin,
impl<T> UnwindSafe for SunriseResult<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)