extern crate rayon_crate as rayon; use auto_enums::enum_derive; enum Enum { A(A), B(B), } impl ::rayon::iter::ParallelIterator for Enum where A: ::rayon::iter::ParallelIterator, B: ::rayon::iter::ParallelIterator< Item = ::Item, >, { type Item = ::Item; #[inline] fn drive_unindexed<__C>(self, consumer: __C) -> __C::Result where __C: ::rayon::iter::plumbing::UnindexedConsumer, { match self { Enum::A(x) => { ::drive_unindexed(x, consumer) } Enum::B(x) => { ::drive_unindexed(x, consumer) } } } #[inline] fn opt_len(&self) -> ::core::option::Option { match self { Enum::A(x) => ::opt_len(x), Enum::B(x) => ::opt_len(x), } } } fn main() {}