Function proptest_arbitrary::arbitrary
[−]
[src]
pub fn arbitrary<T, S, V>() -> S where
V: ValueTree<Value = T>,
S: Strategy<Value = V>,
T: Arbitrary<Strategy = S, ValueTree = V>,
Generates a Strategy producing Arbitrary values of T
.
Works better with type inference than any::<T>()
.
With this version, you shouldn't need to specify any of T
, S
, V
.
This can have a positive effect on type inference.
However, if you want specify T
, you should use any::<T>()
instead.
Example
The function can be used as:
extern crate proptest_arbitrary; use proptest_arbitrary::{arbitrary, Arbitrary}; fn gen_bool(x: bool) -> <bool as Arbitrary>::Strategy { arbitrary() }