@@ -137,8 +137,15 @@ impl<'a, A, D> ArrayView<'a, A, D>
137
137
/// Get a reference of a element through the view.
138
138
///
139
139
/// This method is like `Index::index` but with a longer lifetime (matching
140
- /// the array view); which we can't do for general arrays and not in the
140
+ /// the array view); which we can only do for the array view and not in the
141
141
/// `Index` trait.
142
+ ///
143
+ /// See also [the `get` method][1] which works for all arrays and array
144
+ /// views.
145
+ ///
146
+ /// [1]: struct.ArrayBase.html#method.get
147
+ ///
148
+ /// **Panics** if index is out of bounds.
142
149
pub fn index < I > ( & self , index : I ) -> & ' a A
143
150
where I : NdIndex < D > ,
144
151
{
@@ -154,6 +161,13 @@ impl<'a, A, D> ArrayView<'a, A, D>
154
161
///
155
162
/// This method is like `elem` with a longer lifetime (matching the array
156
163
/// view); which we can't do for general arrays.
164
+ ///
165
+ /// See also [the `uget` method][1] which works for all arrays and array
166
+ /// views.
167
+ ///
168
+ /// [1]: struct.ArrayBase.html#method.uget
169
+ ///
170
+ /// **Note:** only unchecked for non-debug builds of ndarray.
157
171
pub unsafe fn uindex < I > ( & self , index : I ) -> & ' a A
158
172
where I : NdIndex < D > ,
159
173
{
@@ -263,9 +277,16 @@ impl<'a, A, D> ArrayViewMut<'a, A, D>
263
277
264
278
/// Convert a mutable array view to a mutable reference of a element.
265
279
///
266
- /// This method is like `Index::index` but with a longer lifetime (matching
267
- /// the array view); which we can't do for general arrays and not in the
268
- /// `Index` trait.
280
+ /// This method is like `IndexMut::index_mut` but with a longer lifetime
281
+ /// (matching the array view); which we can only do for the array view and
282
+ /// not in the `Index` trait.
283
+ ///
284
+ /// See also [the `get_mut` method][1] which works for all arrays and array
285
+ /// views.
286
+ ///
287
+ /// [1]: struct.ArrayBase.html#method.get_mut
288
+ ///
289
+ /// **Panics** if index is out of bounds.
269
290
pub fn into_index_mut < I > ( mut self , index : I ) -> & ' a mut A
270
291
where I : NdIndex < D > ,
271
292
{
@@ -279,9 +300,15 @@ impl<'a, A, D> ArrayViewMut<'a, A, D>
279
300
}
280
301
}
281
302
282
- /// Convert a mutable array view to a mutable reference of a element without boundary check
303
+ /// Convert a mutable array view to a mutable reference of a element without
304
+ /// boundary check.
305
+ ///
306
+ /// See also [the `uget_mut` method][1] which works for all arrays and array
307
+ /// views.
283
308
///
309
+ /// [1]: struct.ArrayBase.html#method.uget_mut
284
310
///
311
+ /// **Note:** only unchecked for non-debug builds of ndarray.
285
312
pub unsafe fn into_index_mut_unchecked < I > ( mut self , index : I ) -> & ' a mut A
286
313
where I : NdIndex < D >
287
314
{
0 commit comments