pub type BoxedIter = Box + Send>; pub type BoxedLIter<'a, T> = Box + Send + 'a>; pub trait IntoDynBoxed<'a, T> { fn into_dyn_boxed(self) -> BoxedLIter<'a, T>; } impl<'a, T, I: Iterator + Send + 'a> IntoDynBoxed<'a, T> for I { fn into_dyn_boxed(self) -> BoxedLIter<'a, T> { Box::new(self) } }