Trait ArbitraryF2
trait ArbitraryF2<A: fmt::Debug, B: fmt::Debug>: fmt::Debug + Sized
ArbitraryF2 lets you lift Strategy to binary
type constructors such as Result, HashMap.
The trait corresponds to
Haskell QuickCheck's Arbitrary2 type class.
Associated Types
type Parameters: TraitBound { trait_: Path { path: "Default", id: Id(34), args: None }, generic_params: [], modifier: None }The type of parameters that
lift2_withaccepts for configuration of the lifted and generatedStrategy. Parameters must implementDefault.
Required Methods
fn lift2_with<AS, BS>(fst: AS, snd: BS, args: <Self as >::Parameters) -> BoxedStrategy<Self> where AS: Strategy<Value = A> + 'static, BS: Strategy<Value = B> + 'staticLifts two given strategies to a new
Strategyfor the (presumably) bigger type. This is useful for lifting aStrategyforType1and one forType2to a container such asHashMap<Type1, Type2>. The composite strategy is passed the arguments given inargs.If you wish to use the
default()arguments, uselift2instead.
Provided Methods
fn lift2<AS, BS>(fst: AS, snd: BS) -> BoxedStrategy<Self> where AS: Strategy<Value = A> + 'static, BS: Strategy<Value = B> + 'staticLifts two given strategies to a new
Strategyfor the (presumably) bigger type. This is useful for lifting aStrategyforType1and one forType2to a container such asHashMap<Type1, Type2>.Calling this for the type
Xis the equivalent of usingX::lift2_with(base, Default::default()).This method is defined in the trait for optimization for the default if you want to do that. It is a logic error to not preserve the semantics when overriding.
Implementors
impl<A: fmt::Debug + Iterator, B: fmt::Debug + Iterator> ArbitraryF2 for Zip<A, B>impl<A: fmt::Debug + Ord, B: fmt::Debug> ArbitraryF2 for crate::std_facade::BTreeMap<A, B>impl<A: fmt::Debug + Eq + Hash + 'static, B: fmt::Debug + 'static> ArbitraryF2 for hash_map::IntoIter<A, B>impl<A: fmt::Debug + Eq + Hash, B: fmt::Debug> ArbitraryF2 for crate::std_facade::HashMap<A, B>impl<A: fmt::Debug, B: fmt::Debug> ArbitraryF2 for Result<A, B>impl<T, A: fmt::Debug + Iterator<Item = T>, B: fmt::Debug + Iterator<Item = T>> ArbitraryF2 for Chain<A, B>impl<A: fmt::Debug + Ord + 'static, B: fmt::Debug + 'static> ArbitraryF2 for btree_map::IntoIter<A, B>