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
sourceimpl Clone for WeightedError
impl Clone for WeightedError
sourcefn clone(&self) -> WeightedError
fn clone(&self) -> WeightedError
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for WeightedError
impl Debug for WeightedError
sourceimpl Display for WeightedError
impl Display for WeightedError
sourceimpl Error for WeightedError
impl Error for WeightedError
1.30.0fn 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.0fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
sourceimpl PartialEq<WeightedError> for WeightedError
impl PartialEq<WeightedError> for WeightedError
sourcefn eq(&self, other: &WeightedError) -> bool
fn eq(&self, other: &WeightedError) -> bool
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
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more