Enum rand::distributions::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()
source§impl PartialEq for WeightedError
impl PartialEq for WeightedError
source§fn eq(&self, other: &WeightedError) -> bool
fn eq(&self, other: &WeightedError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for WeightedError
impl Eq for WeightedError
impl StructuralEq for WeightedError
impl StructuralPartialEq for WeightedError
Auto Trait Implementations§
impl RefUnwindSafe for WeightedError
impl Send for WeightedError
impl Sync for WeightedError
impl Unpin for WeightedError
impl UnwindSafe for WeightedError
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