Struct diem_proptest_helpers::ValueGenerator
source · pub struct ValueGenerator { /* private fields */ }
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§
source§impl ValueGenerator
impl ValueGenerator
sourcepub fn new_with_rng(rng: TestRng) -> Self
pub fn new_with_rng(rng: TestRng) -> Self
Creates a new value generator with provided RNG
sourcepub fn deterministic() -> Self
pub fn deterministic() -> Self
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.
Trait Implementations§
source§impl Default for ValueGenerator
impl Default for ValueGenerator
source§fn default() -> ValueGenerator
fn default() -> ValueGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValueGenerator
impl !RefUnwindSafe for ValueGenerator
impl Send for ValueGenerator
impl Sync for ValueGenerator
impl Unpin for ValueGenerator
impl !UnwindSafe for ValueGenerator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more