1pub type BoxedLIter<'a, T> = Box<dyn Iterator<Item = T> + Send + Sync + 'a>;
2pub type BoxedLDIter<'a, T> = Box<dyn DoubleEndedIterator<Item = T> + Send + Sync + 'a>;
3pub type BoxedIter<T> = BoxedLIter<'static, T>;
4
5pub trait IntoDynBoxed<'a, T> {
6 fn into_dyn_boxed(self) -> BoxedLIter<'a, T>;
7}
8
9impl<'a, T, I: Iterator<Item = T> + Send + Sync + 'a> IntoDynBoxed<'a, T> for I {
10 fn into_dyn_boxed(self) -> BoxedLIter<'a, T> {
11 Box::new(self)
12 }
13}
14
15pub trait IntoDynDBoxed<'a, T> {
16 fn into_dyn_dboxed(self) -> BoxedLDIter<'a, T>;
17}
18
19impl<'a, T, I: DoubleEndedIterator<Item = T> + Send + Sync + 'a> IntoDynDBoxed<'a, T> for I {
20 fn into_dyn_dboxed(self) -> BoxedLDIter<'a, T> {
21 Box::new(self)
22 }
23}