#[non_exhaustive]pub enum DopplerError {
LengthMismatch {
energies: usize,
cross_sections: usize,
},
InvalidEnergy {
index: usize,
value: f64,
},
UnsortedEnergies {
index: usize,
previous: f64,
current: f64,
},
}Expand description
Errors from Doppler broadening computation (not parameter construction).
Marked #[non_exhaustive] because this enum is publicly exported from
nereids-physics and may grow new validation variants over time (e.g. if
future contracts add bounds on AWR/energy combinations). Without the
attribute, adding a variant would be a SemVer-breaking change for any
downstream crate that exhaustively matches on DopplerError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LengthMismatch
Energy and cross-section arrays have different lengths.
Fields
InvalidEnergy
An energy value is non-finite (NaN/±∞) or non-positive (≤ 0).
The FGM velocity transform computes v = √E, so non-positive or
non-finite energies produce NaN velocities that silently propagate
through the convolution. Per-point guards in the convolution loop
rely on v < FLOOR comparisons which evaluate to false for NaN
(see “NaN bypasses guards” project convention), so the function
would return wrong outputs rather than erroring. The contract is
“every energy is finite and strictly positive.”
Fields
UnsortedEnergies
The energy grid is not strictly increasing at index.
doppler_broaden uses partition_point over the extended velocity
grid (built from energies via v = √E), which has an unspecified
return value on an unsorted slice and therefore would silently
produce garbage indices in release builds. The contract is
“energies are strictly ascending”; duplicate points are also rejected.
Trait Implementations§
Source§impl Debug for DopplerError
impl Debug for DopplerError
Source§impl Display for DopplerError
impl Display for DopplerError
Source§impl Error for DopplerError
impl Error for DopplerError
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()
Source§impl From<DopplerError> for TransmissionError
impl From<DopplerError> for TransmissionError
Source§fn from(e: DopplerError) -> Self
fn from(e: DopplerError) -> Self
Auto Trait Implementations§
impl Freeze for DopplerError
impl RefUnwindSafe for DopplerError
impl Send for DopplerError
impl Sync for DopplerError
impl Unpin for DopplerError
impl UnsafeUnpin for DopplerError
impl UnwindSafe for DopplerError
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.