pub enum StepError {
EphemerisLookup {
source_idx: usize,
target: EphemerisBody,
observer: EphemerisBody,
tdb_jd: f64,
message: String,
},
FrameSwitchTargetMissing {
body_idx: usize,
target_source: usize,
num_sources: usize,
},
}Expand description
Reasons a Simulation step can fail at runtime.
Construct via the variant constructors (the kernel returns these from
step_internal on the relevant failure paths). Inspect via pattern
match. Implements core::error::Error so it composes with ? and
the rest of the standard error-handling ecosystem.
§Reading the carried context
All variant fields are part of the public surface (an enum variant’s
fields inherit the enum’s visibility, so no per-field pub qualifier
is needed or accepted by the language). Downstream recovery logic can
destructure freely:
use astrodyn_runner::StepError;
fn handle(err: StepError) {
match err {
StepError::EphemerisLookup {
source_idx,
tdb_jd,
..
} => {
eprintln!("source {source_idx} missing at TDB JD {tdb_jd}");
}
StepError::FrameSwitchTargetMissing {
body_idx,
target_source,
num_sources,
} => {
eprintln!(
"body {body_idx}: target {target_source} >= {num_sources}"
);
}
}
}Variants§
EphemerisLookup
DE4xx ephemeris lookup failed for a source whose position is driven by an attached ephemeris. Carries enough context to identify the source and the time scale at which the lookup failed.
Fields
target: EphemerisBodyTarget body passed to Ephemeris::get_state_typed.
observer: EphemerisBodyObserver body passed to Ephemeris::get_state_typed.
FrameSwitchTargetMissing
A body’s FrameSwitchConfig
referenced a target_source index that doesn’t correspond to any
registered gravity source. Typically a mid-mission edit hazard
caught at step time when Simulation::validate
wasn’t re-run after the change.
Trait Implementations§
Source§impl Error for StepError
impl Error for StepError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for StepError
impl RefUnwindSafe for StepError
impl Send for StepError
impl Sync for StepError
impl Unpin for StepError
impl UnsafeUnpin for StepError
impl UnwindSafe for StepError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.