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)>
Returns 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
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
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
NoItem
: 0 bytesInvalidWeight
: 0 bytesAllWeightsZero
: 0 bytesTooMany
: 0 bytes