pub enum FunctionErrors<InputError: Error, OutputError: Error> {
Input {
source: InputError,
},
Output {
source: OutputError,
},
}
Expand description
A generic error type for fallible numerical function computations.
This enum is used as a standard wrapper for function-specific errors, distinguishing between failures that occur during input validation and those that occur during output validation (or due to the computation itself resulting in an invalid value according to the defined policy).
§Type Parameters
InputError
: The type of the error that occurs if input validation fails. This is typically a function-specific enum detailing various input-related problems (e.g.,ExpInputErrors
,,LogarithmRealInputErrors
, etc.).OutputError
: The type of the error that occurs if output validation fails. This is usually an error type related to the properties of the scalar value itself, often from thevalidation
module (e.g.,ErrorsValidationRawReal
orErrorsValidationRawComplex
), indicating that the computed result is not valid (e.g., NaN, Infinity).
Variants§
Input
Error due to invalid input values.
This variant is returned when initial validation of the function’s arguments
fails according to the defined validation policy (e.g.,
StrictFinitePolicy
) or due to
domain-specific constraints (e.g., negative input to a real logarithm).
Fields
source: InputError
The source error that occurred during input validation. This provides specific details about why the input was considered invalid.
Output
Error due to the computed output failing validation.
This variant is returned if the result of the computation, even from valid inputs, fails validation according to the defined policy. This typically means the result was non-finite (NaN or Infinity) or otherwise did not meet the criteria for a valid output.
Fields
source: OutputError
The source error that occurred during output validation. This provides specific details about why the computed output was considered invalid.
Trait Implementations§
Source§impl<InputError: Debug + Error, OutputError: Debug + Error> Debug for FunctionErrors<InputError, OutputError>
impl<InputError: Debug + Error, OutputError: Debug + Error> Debug for FunctionErrors<InputError, OutputError>
Source§impl<InputError: Error, OutputError: Error> Display for FunctionErrors<InputError, OutputError>
impl<InputError: Error, OutputError: Error> Display for FunctionErrors<InputError, OutputError>
Source§impl<InputError, OutputError> Error for FunctionErrors<InputError, OutputError>
impl<InputError, OutputError> Error for FunctionErrors<InputError, OutputError>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§fn provide<'_request>(&'_request self, request: &mut Request<'_request>)
fn provide<'_request>(&'_request self, request: &mut Request<'_request>)
error_generic_member_access
)