-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
indexed_parallel_iterator.expanded.rs
50 lines (50 loc) · 1.44 KB
/
indexed_parallel_iterator.expanded.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
extern crate rayon_crate as rayon;
use iter_enum::*;
enum Enum<A, B> {
A(A),
B(B),
}
impl<A, B> ::rayon::iter::IndexedParallelIterator for Enum<A, B>
where
A: ::rayon::iter::IndexedParallelIterator,
B: ::rayon::iter::IndexedParallelIterator<
Item = <A as ::rayon::iter::ParallelIterator>::Item,
>,
{
#[inline]
fn drive<__C>(self, consumer: __C) -> __C::Result
where
__C: ::rayon::iter::plumbing::Consumer<Self::Item>,
{
match self {
Enum::A(x) => {
<A as ::rayon::iter::IndexedParallelIterator>::drive(x, consumer)
}
Enum::B(x) => {
<B as ::rayon::iter::IndexedParallelIterator>::drive(x, consumer)
}
}
}
#[inline]
fn len(&self) -> usize {
match self {
Enum::A(x) => <A as ::rayon::iter::IndexedParallelIterator>::len(x),
Enum::B(x) => <B as ::rayon::iter::IndexedParallelIterator>::len(x),
}
}
#[inline]
fn with_producer<__CB>(self, callback: __CB) -> __CB::Output
where
__CB: ::rayon::iter::plumbing::ProducerCallback<Self::Item>,
{
match self {
Enum::A(x) => {
<A as ::rayon::iter::IndexedParallelIterator>::with_producer(x, callback)
}
Enum::B(x) => {
<B as ::rayon::iter::IndexedParallelIterator>::with_producer(x, callback)
}
}
}
}
fn main() {}