Skip to main content

orx_split_vec/concurrent_iter/
con_iter_owned.rs

1use crate::{ParGrowth, SplitVec};
2use orx_concurrent_iter::IntoConcurrentIter;
3use orx_concurrent_iter::implementations::jagged_arrays::{ConIterJaggedOwned, RawJagged, RawVec};
4
5impl<T, G> IntoConcurrentIter for SplitVec<T, G>
6where
7    G: ParGrowth,
8    T: Send + Sync,
9{
10    type Item = T;
11
12    type IntoIter = ConIterJaggedOwned<T, G>;
13
14    fn into_con_iter(self) -> Self::IntoIter {
15        let arrays = self
16            .fragments
17            .into_iter()
18            .map(|f| RawVec::from(f.into_inner()))
19            .collect();
20        let jagged = RawJagged::new(arrays, self.growth, Some(self.len));
21        jagged.into_con_iter()
22    }
23}