pub trait TypeGenerator: Sized {
    // Required method
    fn generate<D>(driver: &mut D) -> Option<Self>
       where D: Driver;

    // Provided methods
    fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
       where D: Driver { ... }
    fn gen() -> TypeValueGenerator<Self> { ... }
}
Expand description

Generate a value for a given type

Required Methods§

source

fn generate<D>(driver: &mut D) -> Option<Self>
where D: Driver,

Generates a value with the given driver

Provided Methods§

source

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

Mutates an existing value with the given driver

source

fn gen() -> TypeValueGenerator<Self>

Returns a generator for a given type

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TypeGenerator for bool

source§

fn generate<D>(driver: &mut D) -> Option<bool>
where D: Driver,

source§

impl TypeGenerator for char

source§

fn generate<D>(driver: &mut D) -> Option<char>
where D: Driver,

source§

impl TypeGenerator for f32

source§

fn generate<D>(driver: &mut D) -> Option<f32>
where D: Driver,

source§

impl TypeGenerator for f64

source§

fn generate<D>(driver: &mut D) -> Option<f64>
where D: Driver,

source§

impl TypeGenerator for i8

source§

fn generate<D>(driver: &mut D) -> Option<i8>
where D: Driver,

source§

impl TypeGenerator for i16

source§

fn generate<D>(driver: &mut D) -> Option<i16>
where D: Driver,

source§

impl TypeGenerator for i32

source§

fn generate<D>(driver: &mut D) -> Option<i32>
where D: Driver,

source§

impl TypeGenerator for i64

source§

fn generate<D>(driver: &mut D) -> Option<i64>
where D: Driver,

source§

impl TypeGenerator for i128

source§

fn generate<D>(driver: &mut D) -> Option<i128>
where D: Driver,

source§

impl TypeGenerator for isize

source§

fn generate<D>(driver: &mut D) -> Option<isize>
where D: Driver,

source§

impl TypeGenerator for u8

source§

fn generate<D>(driver: &mut D) -> Option<u8>
where D: Driver,

source§

impl TypeGenerator for u16

source§

fn generate<D>(driver: &mut D) -> Option<u16>
where D: Driver,

source§

impl TypeGenerator for u32

source§

fn generate<D>(driver: &mut D) -> Option<u32>
where D: Driver,

source§

impl TypeGenerator for u64

source§

fn generate<D>(driver: &mut D) -> Option<u64>
where D: Driver,

source§

impl TypeGenerator for u128

source§

fn generate<D>(driver: &mut D) -> Option<u128>
where D: Driver,

source§

impl TypeGenerator for ()

source§

fn generate<D>(_driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for usize

source§

fn generate<D>(driver: &mut D) -> Option<usize>
where D: Driver,

source§

impl TypeGenerator for NonZero<i8>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<i8>>
where D: Driver,

source§

impl TypeGenerator for NonZero<i16>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<i16>>
where D: Driver,

source§

impl TypeGenerator for NonZero<i32>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<i32>>
where D: Driver,

source§

impl TypeGenerator for NonZero<i64>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<i64>>
where D: Driver,

source§

impl TypeGenerator for NonZero<i128>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<i128>>
where D: Driver,

source§

impl TypeGenerator for NonZero<isize>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<isize>>
where D: Driver,

source§

impl TypeGenerator for NonZero<u8>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<u8>>
where D: Driver,

source§

impl TypeGenerator for NonZero<u16>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<u16>>
where D: Driver,

source§

impl TypeGenerator for NonZero<u32>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<u32>>
where D: Driver,

source§

impl TypeGenerator for NonZero<u64>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<u64>>
where D: Driver,

source§

impl TypeGenerator for NonZero<u128>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<u128>>
where D: Driver,

source§

impl TypeGenerator for NonZero<usize>

source§

fn generate<D>(driver: &mut D) -> Option<NonZero<usize>>
where D: Driver,

source§

impl TypeGenerator for AtomicBool

source§

fn generate<D>(driver: &mut D) -> Option<AtomicBool>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicI8

source§

fn generate<D>(driver: &mut D) -> Option<AtomicI8>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicI16

source§

fn generate<D>(driver: &mut D) -> Option<AtomicI16>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicI32

source§

fn generate<D>(driver: &mut D) -> Option<AtomicI32>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicI64

source§

fn generate<D>(driver: &mut D) -> Option<AtomicI64>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicIsize

source§

fn generate<D>(driver: &mut D) -> Option<AtomicIsize>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicU8

source§

fn generate<D>(driver: &mut D) -> Option<AtomicU8>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicU16

source§

fn generate<D>(driver: &mut D) -> Option<AtomicU16>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicU32

source§

fn generate<D>(driver: &mut D) -> Option<AtomicU32>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicU64

source§

fn generate<D>(driver: &mut D) -> Option<AtomicU64>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for AtomicUsize

source§

fn generate<D>(driver: &mut D) -> Option<AtomicUsize>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl TypeGenerator for Duration

source§

fn generate<D>(driver: &mut D) -> Option<Duration>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl<A> TypeGenerator for (A,)
where A: TypeGenerator,

source§

fn generate<D_>(driver: &mut D_) -> Option<(A,)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<AA, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA)

source§

impl<AB, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB)

source§

impl<AC, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC)

source§

impl<AD, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD)

source§

impl<AE, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD, AE)

source§

impl<AF, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD, AE> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD, AE, AF)

source§

impl<AG, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD, AE, AF> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AA, AB, AC, AD, AE, AF, AG)

source§

impl<B, A> TypeGenerator for (A, B)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<C, A, B> TypeGenerator for (A, B, C)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<D, A, B, C> TypeGenerator for (A, B, C, D)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<E, A, B, C, D> TypeGenerator for (A, B, C, D, E)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<F, A, B, C, D, E> TypeGenerator for (A, B, C, D, E, F)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<G, A, B, C, D, E, F> TypeGenerator for (A, B, C, D, E, F, G)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<H, A, B, C, D, E, F, G> TypeGenerator for (A, B, C, D, E, F, G, H)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G, H)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<I, A, B, C, D, E, F, G, H> TypeGenerator for (A, B, C, D, E, F, G, H, I)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G, H, I)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<J, A, B, C, D, E, F, G, H, I> TypeGenerator for (A, B, C, D, E, F, G, H, I, J)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G, H, I, J)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<K, A, B, C, D, E, F, G, H, I, J> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G, H, I, J, K)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<L, A, B, C, D, E, F, G, H, I, J, K> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

fn generate<D_>(driver: &mut D_) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<M, A, B, C, D, E, F, G, H, I, J, K, L> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M)

source§

fn generate<D_>( driver: &mut D_ ) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L, M)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<N, A, B, C, D, E, F, G, H, I, J, K, L, M> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

source§

fn generate<D_>( driver: &mut D_ ) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<O, A, B, C, D, E, F, G, H, I, J, K, L, M, N> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

source§

fn generate<D_>( driver: &mut D_ ) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<Ok, Err> TypeGenerator for Result<Ok, Err>
where Ok: TypeGenerator, Err: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<Result<Ok, Err>>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl<P, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

source§

fn generate<D_>( driver: &mut D_ ) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<Q, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

source§

fn generate<D_>( driver: &mut D_ ) -> Option<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)>
where D_: Driver,

source§

fn mutate<D_>(&mut self, driver: &mut D_) -> Option<()>
where D_: Driver,

source§

impl<R, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

source§

impl<S, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

source§

impl<T> TypeGenerator for Cell<T>
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<Cell<T>>
where D: Driver,

source§

impl<T> TypeGenerator for RefCell<T>
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<RefCell<T>>
where D: Driver,

source§

impl<T> TypeGenerator for UnsafeCell<T>
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<UnsafeCell<T>>
where D: Driver,

source§

impl<T> TypeGenerator for PhantomData<T>

source§

fn generate<D>(_driver: &mut D) -> Option<PhantomData<T>>
where D: Driver,

source§

impl<T> TypeGenerator for Range<T>
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<Range<T>>
where D: Driver,

source§

impl<T> TypeGenerator for RangeInclusive<T>
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<RangeInclusive<T>>
where D: Driver,

source§

impl<T, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

source§

impl<T, const LEN: usize> TypeGenerator for [T; LEN]
where T: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<[T; LEN]>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl<U, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

source§

impl<V> TypeGenerator for Option<V>
where V: TypeGenerator,

source§

fn generate<D>(driver: &mut D) -> Option<Option<V>>
where D: Driver,

source§

fn mutate<D>(&mut self, driver: &mut D) -> Option<()>
where D: Driver,

source§

impl<V, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)

source§

impl<W, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)

source§

impl<X, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)

source§

impl<Y, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)

source§

impl<Z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y> TypeGenerator for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Implementors§