pub enum StatsError {
EmptyInput {
metric: &'static str,
},
InsufficientInput {
metric: &'static str,
minimum: usize,
actual: usize,
},
NonFinite {
metric: &'static str,
index: Option<usize>,
value: f64,
},
ProbabilityOutOfRange {
metric: &'static str,
index: Option<usize>,
value: f64,
},
ProbabilityMass {
metric: &'static str,
sum: f64,
},
ZeroEvidence {
metric: &'static str,
},
ZeroTotal {
label: &'static str,
},
ZeroReferenceRate {
metric: &'static str,
},
InvalidControl {
field: &'static str,
reason: &'static str,
},
WorkLimitExceeded {
required: u64,
limit: u64,
},
}Expand description
Errors returned by probability, statistics, and fairness helpers.
Each variant carries the metric name of the helper that rejected the
input, so the failure can be reported without the caller tracking context.
Variants§
EmptyInput
A helper requiring at least one value was given an empty slice.
InsufficientInput
Fewer values were supplied than the helper requires.
Fields
NonFinite
A value was not finite (NaN or infinite).
Fields
ProbabilityOutOfRange
A probability fell outside the closed range 0.0..=1.0.
Fields
ProbabilityMass
A probability vector did not sum to one within tolerance.
Fields
ZeroEvidence
A Bayesian update was given zero total evidence.
ZeroTotal
A counts pair was given a zero total.
ZeroReferenceRate
A fairness ratio was given a zero reference rate to divide by.
InvalidControl
A bounded statistics control contained an invalid field.
Fields
WorkLimitExceeded
A requested computation exceeded its explicit work allowance.
Trait Implementations§
Source§impl Clone for StatsError
impl Clone for StatsError
Source§fn clone(&self) -> StatsError
fn clone(&self) -> StatsError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StatsError
impl Debug for StatsError
Source§impl Display for StatsError
impl Display for StatsError
Source§impl Error for StatsError
impl Error for StatsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()