orx_concurrent_iter/implementations/slice/
into_con_iter.rs1use super::con_iter::ConIterSlice;
2use crate::{concurrent_iterable::ConcurrentIterable, into_concurrent_iter::IntoConcurrentIter};
3
4impl<'a, T> IntoConcurrentIter for &'a [T]
5where
6 T: Sync,
7{
8 type Item = &'a T;
9
10 type IntoIter = ConIterSlice<'a, T>;
11
12 fn into_con_iter(self) -> Self::IntoIter {
13 Self::IntoIter::new(self)
14 }
15}
16
17impl<'a, T> ConcurrentIterable for &'a [T]
18where
19 T: Sync,
20{
21 type Item = &'a T;
22
23 type Iter = ConIterSlice<'a, T>;
24
25 fn con_iter(&self) -> Self::Iter {
26 Self::Iter::new(self)
27 }
28}