#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum CalcError {
DerivativeOrderZero,
StepSizeZero,
IndexOutOfRange,
IterationsZero,
IntegrationLimitsIllDefined,
QuadratureOrderOutOfRange,
EmptyFunctionSet,
}
impl core::fmt::Display for CalcError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str(match self {
CalcError::DerivativeOrderZero => "derivative order cannot be zero",
CalcError::StepSizeZero => "step size cannot be zero",
CalcError::IndexOutOfRange => "variable index out of range",
CalcError::IterationsZero => "number of iterations cannot be zero",
CalcError::IntegrationLimitsIllDefined => {
"lower limit must be strictly less than upper limit"
}
CalcError::QuadratureOrderOutOfRange => "quadrature order is out of supported range",
CalcError::EmptyFunctionSet => "function set cannot be empty",
})
}
}
impl core::error::Error for CalcError {}