Struct test_casing::Product
source · pub struct Product<Ts>(pub Ts);
Expand description
Cartesian product of several test cases.
For now, this supports products of 2..8 values. The provided IntoIterator
expression
for each value must implement Clone
. One way to do that is using TestCases
, which
wraps a lazy iterator initializer and is thus always Copy
able.
§Examples
let product = Product((0..2, ["test", "other"]));
let values: Vec<_> = product.into_iter().collect();
assert_eq!(
values,
[(0, "test"), (0, "other"), (1, "test"), (1, "other")]
);
Tuple Fields§
§0: Ts
Trait Implementations§
source§impl<T, U> IntoIterator for Product<(T, U)>
impl<T, U> IntoIterator for Product<(T, U)>
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item)
The type of the elements being iterated over.
§type IntoIter = ProductIter<T, U>
type IntoIter = ProductIter<T, U>
Which kind of iterator are we turning this into?
source§impl<T, U, V> IntoIterator for Product<(T, U, V)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
impl<T, U, V> IntoIterator for Product<(T, U, V)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item)
The type of the elements being iterated over.
source§impl<T, U, V, W> IntoIterator for Product<(T, U, V, W)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
impl<T, U, V, W> IntoIterator for Product<(T, U, V, W)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item)
The type of the elements being iterated over.
§type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W)> as IntoIterator>::Item>>
type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W)> as IntoIterator>::Item>>
Which kind of iterator are we turning this into?
source§impl<T, U, V, W, X> IntoIterator for Product<(T, U, V, W, X)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
impl<T, U, V, W, X> IntoIterator for Product<(T, U, V, W, X)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item)
The type of the elements being iterated over.
§type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X)> as IntoIterator>::Item>>
type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X)> as IntoIterator>::Item>>
Which kind of iterator are we turning this into?
source§impl<T, U, V, W, X, Y> IntoIterator for Product<(T, U, V, W, X, Y)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
Y: 'static + Clone + IntoIterator,
impl<T, U, V, W, X, Y> IntoIterator for Product<(T, U, V, W, X, Y)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
Y: 'static + Clone + IntoIterator,
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item, <Y as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item, <Y as IntoIterator>::Item)
The type of the elements being iterated over.
§type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X, Y)> as IntoIterator>::Item>>
type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X, Y)> as IntoIterator>::Item>>
Which kind of iterator are we turning this into?
source§impl<T, U, V, W, X, Y, Z> IntoIterator for Product<(T, U, V, W, X, Y, Z)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
Y: 'static + Clone + IntoIterator,
Z: 'static + Clone + IntoIterator,
impl<T, U, V, W, X, Y, Z> IntoIterator for Product<(T, U, V, W, X, Y, Z)>where
T: 'static + Clone + IntoIterator,
U: 'static + Clone + IntoIterator,
V: 'static + Clone + IntoIterator,
W: 'static + Clone + IntoIterator,
X: 'static + Clone + IntoIterator,
Y: 'static + Clone + IntoIterator,
Z: 'static + Clone + IntoIterator,
§type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item, <Y as IntoIterator>::Item, <Z as IntoIterator>::Item)
type Item = (<T as IntoIterator>::Item, <U as IntoIterator>::Item, <V as IntoIterator>::Item, <W as IntoIterator>::Item, <X as IntoIterator>::Item, <Y as IntoIterator>::Item, <Z as IntoIterator>::Item)
The type of the elements being iterated over.
§type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X, Y, Z)> as IntoIterator>::Item>>
type IntoIter = Box<dyn Iterator<Item = <Product<(T, U, V, W, X, Y, Z)> as IntoIterator>::Item>>
Which kind of iterator are we turning this into?
impl<Ts: Copy> Copy for Product<Ts>
Auto Trait Implementations§
impl<Ts> RefUnwindSafe for Product<Ts>where
Ts: RefUnwindSafe,
impl<Ts> Send for Product<Ts>where
Ts: Send,
impl<Ts> Sync for Product<Ts>where
Ts: Sync,
impl<Ts> Unpin for Product<Ts>where
Ts: Unpin,
impl<Ts> UnwindSafe for Product<Ts>where
Ts: 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
Mutably borrows from an owned value. Read more