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 PartialEq for WeightedError
impl PartialEq for WeightedError
impl Copy for WeightedError
impl Eq for WeightedError
impl StructuralPartialEq for WeightedError
Auto Trait Implementations§
impl Freeze for WeightedError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)