File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,10 @@ use super::conversion::Convert;
26
26
27
27
/// Array shape and index trait.
28
28
///
29
- /// `unsafe` because of the assumptions in the default methods.
29
+ /// This trait defines a number of methods and operations that can be used on
30
+ /// dimensions and indices.
30
31
///
31
- /// ***Don't implement this trait, it will evolve at will.** *
32
+ /// ***Note:*** * Don't implement this trait. *
32
33
pub unsafe trait Dimension : Clone + Eq + Debug + Send + Sync + Default +
33
34
IndexMut < usize , Output =usize > +
34
35
Add < Self , Output =Self > +
Original file line number Diff line number Diff line change @@ -285,6 +285,20 @@ pub type Ixs = isize;
285
285
/// array[[1, 1]] = 7;
286
286
/// ```
287
287
///
288
+ /// Important traits and types for dimension and indexing:
289
+ ///
290
+ /// - A [`Dim`](Dim.t.html) value represents a dimensionality or index.
291
+ /// - Trait [`Dimension`](Dimension.t.html) is implemented by all
292
+ /// dimensionalities. It defines many operations for dimensions and indices.
293
+ /// - Trait [`IntoDimension`](IntoDimension.t.html) is used to convert into a
294
+ /// `Dim` value.
295
+ /// - Trait [`ShapeBuilder`](ShapeBuilder.t.html) is an extension of
296
+ /// `IntoDimension` and is used when constructing an array. A shape describes
297
+ /// not just the extent of each axis but also their strides.
298
+ /// - Trait [`NdIndex`](NdIndex.t.html) is an extension of `Dimension` and is
299
+ /// for values that can be used with indexing syntax.
300
+ ///
301
+ ///
288
302
/// The default memory order of an array is *row major* order (a.k.a “c” order),
289
303
/// where each row is contiguous in memory.
290
304
/// A *column major* (a.k.a. “f” or fortran) memory order array has
You can’t perform that action at this time.
0 commit comments