pub struct TupleUnion<T>(/* private fields */);
Expand description
Similar to Union
, but internally uses a tuple to hold the strategies.
This allows better performance than vanilla Union
since one does not need
to resort to boxing and dynamic dispatch to handle heterogeneous
strategies.
The difference between this and TupleUnion
is that with this, value trees
for variants that aren’t picked at first are generated lazily.
Implementations§
source§impl<T> TupleUnion<T>
impl<T> TupleUnion<T>
sourcepub fn new(tuple: T) -> Self
pub fn new(tuple: T) -> Self
Wrap tuple
in a TupleUnion
.
The struct definition allows any T
for tuple
, but to be useful, it
must be a 2- to 10-tuple of (u32, Arc<impl Strategy>)
pairs where all
strategies ultimately produce the same value. Each u32
indicates the
relative weight of its corresponding strategy.
You may use WA<S>
as an alias for (u32, Arc<S>)
.
Using this constructor directly is discouraged; prefer to use
prop_oneof!
since it is generally clearer.
Trait Implementations§
source§impl<T: Clone> Clone for TupleUnion<T>
impl<T: Clone> Clone for TupleUnion<T>
source§fn clone(&self) -> TupleUnion<T>
fn clone(&self) -> TupleUnion<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug> Debug for TupleUnion<T>
impl<T: Debug> Debug for TupleUnion<T>
source§impl<A: Strategy, B: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>)>
impl<A: Strategy, B: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>, I: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>, WA<I>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>, I: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>, WA<I>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>, Option<LazyValueTree<I>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>, Option<LazyValueTree<I>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moresource§impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>, I: Strategy<Value = A::Value>, J: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>, WA<I>, WA<J>)>
impl<A: Strategy, B: Strategy<Value = A::Value>, C: Strategy<Value = A::Value>, D: Strategy<Value = A::Value>, E: Strategy<Value = A::Value>, F: Strategy<Value = A::Value>, G: Strategy<Value = A::Value>, H: Strategy<Value = A::Value>, I: Strategy<Value = A::Value>, J: Strategy<Value = A::Value>> Strategy for TupleUnion<(WA<A>, WA<B>, WA<C>, WA<D>, WA<E>, WA<F>, WA<G>, WA<H>, WA<I>, WA<J>)>
source§type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>, Option<LazyValueTree<I>>, Option<LazyValueTree<J>>)>
type Tree = TupleUnionValueTree<(LazyValueTree<A>, Option<LazyValueTree<B>>, Option<LazyValueTree<C>>, Option<LazyValueTree<D>>, Option<LazyValueTree<E>>, Option<LazyValueTree<F>>, Option<LazyValueTree<G>>, Option<LazyValueTree<H>>, Option<LazyValueTree<I>>, Option<LazyValueTree<J>>)>
Strategy
.source§type Value = <A as Strategy>::Value
type Value = <A as Strategy>::Value
source§fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>
source§fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fn prop_map<O: Debug, F: Fn(Self::Value) -> O>(self, fun: F) -> Map<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
fn prop_map_into<O: Debug>(self) -> MapInto<Self, O>
source§fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fn prop_perturb<O: Debug, F: Fn(Self::Value, TestRng) -> O>(
self,
fun: F,
) -> Perturb<Self, F>where
Self: Sized,
fun
, which is additionally given a random number generator. Read moresource§fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
fn prop_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> Flatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
fn prop_ind_flat_map<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlatten<Map<Self, F>>where
Self: Sized,
source§fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
fn prop_ind_flat_map2<S: Strategy, F: Fn(Self::Value) -> S>(
self,
fun: F,
) -> IndFlattenMap<Self, F>where
Self: Sized,
prop_ind_flat_map()
, but produces 2-tuples with the input
generated from self
in slot 0 and the derived strategy in slot 1. Read moresource§fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fn prop_filter<R: Into<Reason>, F: Fn(&Self::Value) -> bool>(
self,
whence: R,
fun: F,
) -> Filter<Self, F>where
Self: Sized,
fun
. Read moresource§fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fn prop_filter_map<F: Fn(Self::Value) -> Option<O>, O: Debug>(
self,
whence: impl Into<Reason>,
fun: F,
) -> FilterMap<Self, F>where
Self: Sized,
fun
returns Some(value)
and rejects those where fun
returns None
. Read moresource§fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
fn prop_union(self, other: Self) -> Union<Self>where
Self: Sized,
source§fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
fn prop_recursive<R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R>(
self,
depth: u32,
desired_size: u32,
expected_branch_size: u32,
recurse: F,
) -> Recursive<Self::Value, F>where
Self: Sized + 'static,
self
items as leaves. Read moreimpl<T: Copy> Copy for TupleUnion<T>
Auto Trait Implementations§
impl<T> Freeze for TupleUnion<T>where
T: Freeze,
impl<T> RefUnwindSafe for TupleUnion<T>where
T: RefUnwindSafe,
impl<T> Send for TupleUnion<T>where
T: Send,
impl<T> Sync for TupleUnion<T>where
T: Sync,
impl<T> Unpin for TupleUnion<T>where
T: Unpin,
impl<T> UnwindSafe for TupleUnion<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)