Enum rand::distributions::weighted::WeightedError
source · pub enum WeightedError {
NoItem,
InvalidWeight,
AllWeightsZero,
TooMany,
}
Expand description
Error type returned from WeightedIndex::new
.
Variants§
NoItem
The provided weight collection contains no items.
InvalidWeight
A weight is either less than zero, greater than the supported maximum, NaN, or otherwise invalid.
AllWeightsZero
All items in the provided weight collection are zero.
TooMany
Too many weights are provided (length greater than u32::MAX
)
Trait Implementations§
source§impl Clone for WeightedError
impl Clone for WeightedError
source§fn clone(&self) -> WeightedError
fn clone(&self) -> WeightedError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WeightedError
impl Debug for WeightedError
source§impl Display for WeightedError
impl Display for WeightedError
source§impl Error for WeightedError
impl Error for WeightedError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()