Enum Error
#[non_exhaustive]
pub enum Error
Invalid weight errors
This type represents errors from WeightedIndex::new,
WeightedIndex::update_weights and other weighted distributions.
Variants
-
InvalidInput The input weight sequence is empty, too long, or wrongly ordered
-
InvalidWeight A weight is negative, too large for the distribution, or not a valid number
-
InsufficientNonZero Not enough non-zero weights are available to sample values
When attempting to sample a single value this implies that all weights are zero. When attempting to sample
amountvalues this implies that less thanamountweights are greater than zero.-
Overflow Overflow when calculating the sum of weights
Trait Implementations
impl Clone for Error
fn clone(&self) -> Self
impl Copy for Error
impl Debug for Error
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Error
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Error
impl Error for Error
impl PartialEq for Error
fn eq(&self, other: &Self) -> bool