Struct diem_proptest_helpers::ValueGenerator[][src]

pub struct ValueGenerator { /* fields omitted */ }
Expand description

Context for generating single values out of strategies.

Proptest is designed to be built around “value trees”, which represent a spectrum from complex values to simpler ones. But in some contexts, like benchmarking or generating corpuses, one just wants a single value. This is a convenience struct for that.

Implementations

Creates a new value generator with the default RNG.

Creates a new value generator with provided RNG

Creates a new value generator with a deterministic RNG.

This generator has a hardcoded seed, so its results are predictable across test runs. However, a new proptest version may change the seed.

Generates a single value for this strategy.

Panics if generating the new value fails. The only situation in which this can happen is if generating the value causes too many internal rejects.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.