Function suppositions::generators::one_of [] [src]

pub fn one_of<G: Generator + 'static>(inner: G) -> OneOfGenerator<OneOfTerm<G>>

Allows the user to use one of a set of alternative generators. Often useful when you need to generate elements of an enum.

use suppositions::generators::*;
fn option_of_u8() {
    let g = one_of(consts(None)).or(u8s().map(Some));
    //
}