[][src]Struct rand::distributions::WeightedChoice

pub struct WeightedChoice<'a, T: 'a> { /* fields omitted */ }
Deprecated since 0.6.0:

use WeightedIndex instead

A distribution that selects from a finite collection of weighted items.

Deprecated: use WeightedIndex instead.

Methods

impl<'a, T: Clone> WeightedChoice<'a, T>[src]

pub fn new(items: &'a mut [Weighted<T>]) -> WeightedChoice<'a, T>[src]

Deprecated since 0.6.0:

use WeightedIndex instead

Create a new WeightedChoice.

Panics if:

  • items is empty
  • the total weight is 0
  • the total weight is larger than a u32 can contain.

Trait Implementations

impl<'a, T: Clone> Distribution<T> for WeightedChoice<'a, T>[src]

impl<'a, T: Debug + 'a> Debug for WeightedChoice<'a, T>[src]

Auto Trait Implementations

impl<'a, T> Send for WeightedChoice<'a, T> where
    T: Send

impl<'a, T> Unpin for WeightedChoice<'a, T>

impl<'a, T> Sync for WeightedChoice<'a, T> where
    T: Sync

impl<'a, T> !UnwindSafe for WeightedChoice<'a, T>

impl<'a, T> RefUnwindSafe for WeightedChoice<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]