orx_concurrent_iter/implementations/vec/
into_con_iter.rs

1use super::con_iter::ConIterVec;
2use crate::{implementations::slice::ConIterSlice, into_concurrent_iter::IntoConcurrentIter};
3use alloc::vec::Vec;
4
5impl<T> IntoConcurrentIter for Vec<T>
6where
7    T: Send + Sync,
8{
9    type Item = T;
10
11    type IntoIter = ConIterVec<T>;
12
13    fn into_con_iter(self) -> Self::IntoIter {
14        Self::IntoIter::new(self)
15    }
16}
17
18impl<'a, T> IntoConcurrentIter for &'a Vec<T>
19where
20    T: Send + Sync,
21{
22    type Item = &'a T;
23
24    type IntoIter = ConIterSlice<'a, T>;
25
26    fn into_con_iter(self) -> Self::IntoIter {
27        Self::IntoIter::new(self.as_slice())
28    }
29}