#[non_exhaustive]pub enum ValidationError {
ShapeMismatch,
NotSquare,
NotFinite,
Negative,
DivideByZero(&'static str),
NonMonotoneCumulative {
origin: usize,
dev: usize,
previous: f64,
value: f64,
},
InvalidTail {
tail: f64,
},
InvalidMaturity {
index: usize,
value: f64,
},
InvalidProbability {
value: f64,
},
InvalidIterations,
NonPositive(&'static str),
InvalidParameter(&'static str),
}Expand description
Validation failure modes for triangle inputs.
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.
ShapeMismatch
data.len() != n_origins * n_devs.
NotSquare
Triangle must be square (n_origins == n_devs) for the reserving
kernels as implemented here.
NotFinite
An observed cell held a non-finite value other than NaN.
Negative
An observed cell held a negative cumulative loss.
DivideByZero(&'static str)
A required denominator was zero (column sum or observed-cell value).
NonMonotoneCumulative
An observed cumulative row decreased.
Fields
InvalidTail
Tail factor is below the supported cumulative-development minimum.
InvalidMaturity
Maturity percentage is outside [0, 1].
InvalidProbability
Probability or confidence level is outside [0, 1].
InvalidIterations
Simulation or bootstrap iteration count is zero.
NonPositive(&'static str)
A required strictly positive input was zero or negative.
InvalidParameter(&'static str)
Model or matrix specification is invalid or numerically singular.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
impl Copy for ValidationError
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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()
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§impl Serialize for ValidationError
impl Serialize for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Forget for ValidationError
impl Freeze for ValidationError
impl Move for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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