#[non_exhaustive]pub enum Error {
NotFinite {
input: Input,
value: f64,
},
NotPositive {
input: Input,
value: f64,
},
Negative {
input: Input,
value: f64,
},
ProbabilityOutOfRange {
value: f64,
},
Overflow {
quantity: &'static str,
},
}Expand description
An input rejected at the API boundary.
Every variant names the offending input and its value, or the derived quantity that is not representable, so the caller can report it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotFinite
The input is NaN or infinite.
NotPositive
The input must be greater than zero.
Negative
The input must be zero or greater.
ProbabilityOutOfRange
A probability is not strictly between 0 and 1.
Overflow
The inputs are individually valid but a quantity derived from them
is not a finite f64 (for example exp(−r·T) for a large negative
r·T).
Trait Implementations§
impl Copy for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Errorwhere
&'static str: UnsafeUnpin,
impl UnwindSafe for Errorwhere
&'static str: 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
Mutably borrows from an owned value. Read more