Choosable

Trait Choosable 

Source
pub trait Choosable<T, R: Rand> {
    // Required methods
    fn choose_filtered<P>(&self, filter: P, rand: &mut R) -> Option<&T>
       where P: FnMut(&&T) -> bool;
    fn choose(&self, rand: &mut R) -> Option<&T>;
}

Required Methods§

Source

fn choose_filtered<P>(&self, filter: P, rand: &mut R) -> Option<&T>
where P: FnMut(&&T) -> bool,

Source

fn choose(&self, rand: &mut R) -> Option<&T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, R: Rand> Choosable<T, R> for Vec<T>

Source§

fn choose_filtered<P>(&self, filter: P, rand: &mut R) -> Option<&T>
where P: FnMut(&&T) -> bool,

Source§

fn choose(&self, rand: &mut R) -> Option<&T>

Implementors§