extern crate rayon_crate as rayon; use auto_enums::enum_derive; enum Enum { A(A), B(B), } impl ::rayon::iter::ParallelExtend<__T> for Enum where A: ::rayon::iter::ParallelExtend<__T>, B: ::rayon::iter::ParallelExtend<__T>, { #[inline] fn par_extend<__I>(&mut self, par_iter: __I) where __I: ::rayon::iter::IntoParallelIterator, { match self { Enum::A(x) => { >::par_extend(x, par_iter) } Enum::B(x) => { >::par_extend(x, par_iter) } } } } fn main() {}