quad_rand

Trait ChooseRandom

Source
pub trait ChooseRandom<T> {
    // Required methods
    fn shuffle_with_state(&mut self, state: &RandGenerator);
    fn choose_with_state(&self, state: &RandGenerator) -> Option<&T>;
    fn choose_mut_with_state(&mut self, state: &RandGenerator) -> Option<&mut T>;
    fn choose_multiple_with_state(
        &self,
        state: &RandGenerator,
        _amount: usize,
    ) -> SliceChooseIter<'_, T> ;

    // Provided methods
    fn shuffle(&mut self) { ... }
    fn choose(&self) -> Option<&T> { ... }
    fn choose_mut(&mut self) -> Option<&mut T> { ... }
    fn choose_multiple(&self, amount: usize) -> SliceChooseIter<'_, T>  { ... }
}

Required Methods§

Provided Methods§

Source

fn shuffle(&mut self)

Source

fn choose(&self) -> Option<&T>

Source

fn choose_mut(&mut self) -> Option<&mut T>

Source

fn choose_multiple(&self, amount: usize) -> SliceChooseIter<'_, T>

Implementations on Foreign Types§

Source§

impl<T> ChooseRandom<T> for [T]

Implementors§