pub struct EclipseEngine<B> { /* private fields */ }Expand description
Searches for global/geocentric eclipses over a chosen EphemerisBackend.
Backed by the packaged data, results are valid only within the
1900-01-01..2100-01-01 window (see crate); out-of-window requests fail
closed with EclipseError::OutOfWindow.
Implementations§
Source§impl<B: EphemerisBackend> EclipseEngine<B>
impl<B: EphemerisBackend> EclipseEngine<B>
Sourcepub fn eclipses_in_range(
&self,
start: Instant,
end: Instant,
filter: EclipseFilter,
) -> Result<Vec<Eclipse>, EclipseError>
pub fn eclipses_in_range( &self, start: Instant, end: Instant, filter: EclipseFilter, ) -> Result<Vec<Eclipse>, EclipseError>
Returns every eclipse admitted by filter with greatest eclipse in
[start, end], in chronological order. Fails closed if either bound is
outside the supported window.
Sourcepub fn next_eclipse(
&self,
after: Instant,
filter: EclipseFilter,
) -> Result<Option<Eclipse>, EclipseError>
pub fn next_eclipse( &self, after: Instant, filter: EclipseFilter, ) -> Result<Option<Eclipse>, EclipseError>
Returns the first eclipse admitted by filter whose greatest eclipse is
strictly after after, or None if none remains before the window end.
Sourcepub fn previous_eclipse(
&self,
before: Instant,
filter: EclipseFilter,
) -> Result<Option<Eclipse>, EclipseError>
pub fn previous_eclipse( &self, before: Instant, filter: EclipseFilter, ) -> Result<Option<Eclipse>, EclipseError>
Returns the last eclipse admitted by filter whose greatest eclipse is
strictly before before, or None if none exists after the window start.
Sourcepub fn local_circumstances(
&self,
eclipse: &Eclipse,
observer: &ObserverLocation,
atmosphere: Atmosphere,
) -> Result<LocalCircumstances, EclipseError>
pub fn local_circumstances( &self, eclipse: &Eclipse, observer: &ObserverLocation, atmosphere: Atmosphere, ) -> Result<LocalCircumstances, EclipseError>
Local (per-observer) circumstances for an already-found eclipse.
Returns full circumstances even when the eclipse is not visible from
observer (all contacts below the horizon); inspect any_phase_visible
(via the returned variant) to test visibility. Solar contact instants are
observer-dependent (topocentric); lunar contact instants are global with
per-observer visibility.
Sourcepub fn next_local_eclipse(
&self,
after: Instant,
observer: &ObserverLocation,
filter: EclipseFilter,
atmosphere: Atmosphere,
) -> Result<Option<(Eclipse, LocalCircumstances)>, EclipseError>
pub fn next_local_eclipse( &self, after: Instant, observer: &ObserverLocation, filter: EclipseFilter, atmosphere: Atmosphere, ) -> Result<Option<(Eclipse, LocalCircumstances)>, EclipseError>
The next eclipse admitted by filter, strictly after after, that is
locally visible from observer (any phase above the horizon), paired with
its local circumstances. Walks the global next_eclipse sequence and
returns the first locally-visible one, so the result is a strict refinement
of the global engine.
Sourcepub fn previous_local_eclipse(
&self,
before: Instant,
observer: &ObserverLocation,
filter: EclipseFilter,
atmosphere: Atmosphere,
) -> Result<Option<(Eclipse, LocalCircumstances)>, EclipseError>
pub fn previous_local_eclipse( &self, before: Instant, observer: &ObserverLocation, filter: EclipseFilter, atmosphere: Atmosphere, ) -> Result<Option<(Eclipse, LocalCircumstances)>, EclipseError>
The previous eclipse admitted by filter, strictly before before, that
is locally visible from observer, paired with its local circumstances.