Enum rand::distributions::WeightedError
source · [−]pub enum WeightedError {
NoItem,
NegativeWeight,
AllWeightsZero,
}
Expand description
Error type returned from WeightedIndex::new
.
Variants
NoItem
The provided iterator contained no items.
NegativeWeight
A weight lower than zero was used.
AllWeightsZero
All items in the provided iterator had a weight of zero.
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.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for WeightedError
impl Debug for WeightedError
sourceimpl Display for WeightedError
impl Display for WeightedError
sourceimpl Error for WeightedError
impl Error for WeightedError
sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourcefn 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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more