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 thecore::errorsmodule (e.g.,ErrorsValidationRawRealorErrorsValidationRawComplex), 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: InputErrorThe 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: OutputErrorThe 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)1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl<InputError, OutputError> Freeze for FunctionErrors<InputError, OutputError>
impl<InputError, OutputError> RefUnwindSafe for FunctionErrors<InputError, OutputError>where
InputError: RefUnwindSafe,
OutputError: RefUnwindSafe,
impl<InputError, OutputError> Send for FunctionErrors<InputError, OutputError>
impl<InputError, OutputError> Sync for FunctionErrors<InputError, OutputError>
impl<InputError, OutputError> Unpin for FunctionErrors<InputError, OutputError>
impl<InputError, OutputError> UnsafeUnpin for FunctionErrors<InputError, OutputError>where
InputError: UnsafeUnpin,
OutputError: UnsafeUnpin,
impl<InputError, OutputError> UnwindSafe for FunctionErrors<InputError, OutputError>where
InputError: UnwindSafe,
OutputError: UnwindSafe,
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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