pub trait Choose {
    type Item;

    // Required method
    fn choose(&self, lcg: &mut Lcg) -> Option<&Self::Item>;
}
Expand description

Allows random sampling on an object.

Required Associated Types§

source

type Item

The type of the object.

Required Methods§

source

fn choose(&self, lcg: &mut Lcg) -> Option<&Self::Item>

Selects a random item from the collection.

Implementations on Foreign Types§

source§

impl<T> Choose for [T]

§

type Item = T

source§

fn choose(&self, lcg: &mut Lcg) -> Option<&Self::Item>

Implementors§