11//! Parallel iterators for matrices compatible with rayon.
22
3- // only enables the `doc_cfg` feature when
4- // the `docsrs` configuration attribute is defined
5- #![ cfg_attr( docsrs, feature( doc_cfg) ) ]
6-
73use crate :: {
84 iter:: { ColumnIter , ColumnIterMut } ,
95 Dim , Matrix , MatrixView , MatrixViewMut , RawStorage , RawStorageMut , Scalar , U1 ,
@@ -15,9 +11,10 @@ use rayon::{iter::plumbing::bridge, prelude::*};
1511/// using the [`par_column_iter`] method of [`Matrix`].
1612///
1713/// *Only available if compiled with the feature `rayon`.*
14+ ///
1815/// [`par_column_iter`]: crate::Matrix::par_column_iter
1916/// [`Matrix`]: crate::Matrix
20- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
17+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
2118pub struct ParColumnIter < ' a , T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > {
2219 mat : & ' a Matrix < T , R , Cols , S > ,
2320}
@@ -29,7 +26,7 @@ impl<'a, T, R: Dim, Cols: Dim, S: RawStorage<T, R, Cols>> ParColumnIter<'a, T, R
2926 }
3027}
3128
32- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
29+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
3330impl < ' a , T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > ParallelIterator
3431 for ParColumnIter < ' a , T , R , Cols , S >
3532where
@@ -50,10 +47,10 @@ where
5047 }
5148}
5249
53- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
50+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
5451/// *Only available if compiled with the feature `rayon`.*
55- impl < ' a , T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > IndexedParallelIterator
56- for ParColumnIter < ' a , T , R , Cols , S >
52+ impl < T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > IndexedParallelIterator
53+ for ParColumnIter < ' _ , T , R , Cols , S >
5754where
5855 T : Send + Sync + Scalar ,
5956 S : Sync ,
7572 }
7673}
7774
78- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
75+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
7976/// A rayon parallel iterator through the mutable columns of a matrix.
8077/// *Only available if compiled with the feature `rayon`.*
8178pub struct ParColumnIterMut <
@@ -88,7 +85,7 @@ pub struct ParColumnIterMut<
8885 mat : & ' a mut Matrix < T , R , Cols , S > ,
8986}
9087
91- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
88+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
9289/// *only available if compiled with the feature `rayon`*
9390impl < ' a , T , R , Cols , S > ParColumnIterMut < ' a , T , R , Cols , S >
9491where
10299 }
103100}
104101
105- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
102+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
106103/// *Only available if compiled with the feature `rayon`*
107104impl < ' a , T , R , Cols , S > ParallelIterator for ParColumnIterMut < ' a , T , R , Cols , S >
108105where
@@ -125,9 +122,9 @@ where
125122 }
126123}
127124
128- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
125+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
129126/// *Only available if compiled with the feature `rayon`*
130- impl < ' a , T , R , Cols , S > IndexedParallelIterator for ParColumnIterMut < ' a , T , R , Cols , S >
127+ impl < T , R , Cols , S > IndexedParallelIterator for ParColumnIterMut < ' _ , T , R , Cols , S >
131128where
132129 R : Dim ,
133130 Cols : Dim ,
@@ -152,7 +149,7 @@ where
152149 }
153150}
154151
155- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
152+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
156153/// # Parallel iterators using `rayon`
157154/// *Only available if compiled with the feature `rayon`*
158155impl < T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > Matrix < T , R , Cols , S >
@@ -225,7 +222,7 @@ where
225222/// rayon trait part of the public interface of the `ColumnIter`.
226223struct ColumnProducer < ' a , T , R : Dim , C : Dim , S : RawStorage < T , R , C > > ( ColumnIter < ' a , T , R , C , S > ) ;
227224
228- #[ cfg_attr( doc_cfg , doc( cfg( feature = "rayon" ) ) ) ]
225+ #[ cfg_attr( docsrs , doc( cfg( feature = "rayon" ) ) ) ]
229226/// *only available if compiled with the feature `rayon`*
230227impl < ' a , T , R : Dim , Cols : Dim , S : RawStorage < T , R , Cols > > Producer
231228 for ColumnProducer < ' a , T , R , Cols , S >
0 commit comments