ndarray/parallel/
into_impls.rs1use crate::{ArcArray, Array, ArrayView, ArrayViewMut, Dimension};
2
3use super::prelude::IntoParallelIterator;
4use super::Parallel;
5
6impl<'a, A, D> IntoParallelIterator for &'a Array<A, D>
8where
9 D: Dimension,
10 A: Sync,
11{
12 type Item = &'a A;
13 type Iter = Parallel<ArrayView<'a, A, D>>;
14 fn into_par_iter(self) -> Self::Iter
15 {
16 self.view().into_par_iter()
17 }
18}
19
20impl<'a, A, D> IntoParallelIterator for &'a ArcArray<A, D>
23where
24 D: Dimension,
25 A: Sync,
26{
27 type Item = &'a A;
28 type Iter = Parallel<ArrayView<'a, A, D>>;
29 fn into_par_iter(self) -> Self::Iter
30 {
31 self.view().into_par_iter()
32 }
33}
34
35impl<'a, A, D> IntoParallelIterator for &'a mut Array<A, D>
37where
38 D: Dimension,
39 A: Sync + Send,
40{
41 type Item = &'a mut A;
42 type Iter = Parallel<ArrayViewMut<'a, A, D>>;
43 fn into_par_iter(self) -> Self::Iter
44 {
45 self.view_mut().into_par_iter()
46 }
47}
48
49impl<'a, A, D> IntoParallelIterator for &'a mut ArcArray<A, D>
52where
53 D: Dimension,
54 A: Sync + Send + Clone,
55{
56 type Item = &'a mut A;
57 type Iter = Parallel<ArrayViewMut<'a, A, D>>;
58 fn into_par_iter(self) -> Self::Iter
59 {
60 self.view_mut().into_par_iter()
61 }
62}