|
29 | 29 | //! dimensions, then an element in the array is accessed by using that many indices.
|
30 | 30 | //! Each dimension is also called an *axis*.
|
31 | 31 | //!
|
| 32 | +//! To get started, functionality is provided in the following core types: |
32 | 33 | //! - **[`ArrayBase`]**:
|
33 | 34 | //! The *n*-dimensional array type itself.<br>
|
34 | 35 | //! It is used to implement both the owned arrays and the views; see its docs
|
35 | 36 | //! for an overview of all array features.<br>
|
36 | 37 | //! - The main specific array type is **[`Array`]**, which owns
|
37 | 38 | //! its elements.
|
| 39 | +//! - A reference type, **[`ArrayRef`]**, that contains most of the functionality |
| 40 | +//! for reading and writing to arrays. |
| 41 | +//! - A reference type, **[`LayoutRef`]**, that contains most of the functionality |
| 42 | +//! for reading and writing to array layouts: their shape and strides. |
38 | 43 | //!
|
39 | 44 | //! ## Highlights
|
40 | 45 | //!
|
@@ -1473,6 +1478,17 @@ pub struct LayoutRef<A, D>
|
1473 | 1478 | #[repr(transparent)]
|
1474 | 1479 | pub struct ArrayRef<A, D>(LayoutRef<A, D>);
|
1475 | 1480 |
|
| 1481 | +/// A reference to an *n*-dimensional array whose data is not safe to read or write. |
| 1482 | +/// |
| 1483 | +/// This type is similar to [`ArrayRef`] but does not guarantee that its data is safe |
| 1484 | +/// to read or write; i.e., the underlying data may come from a shared array or be otherwise |
| 1485 | +/// unsafe to dereference. This type should be used sparingly and with extreme caution; |
| 1486 | +/// most of its methods either provide pointers or return [`RawArrayView`], both of |
| 1487 | +/// which tend to be full of unsafety. |
| 1488 | +/// |
| 1489 | +/// For the few times when this type is appropriate, it has the same `AsRef` semantics |
| 1490 | +/// as [`LayoutRef`]; see [its documentation on writing functions](LayoutRef#writing-functions) |
| 1491 | +/// for information on how to properly handle functionality on this type. |
1476 | 1492 | #[repr(transparent)]
|
1477 | 1493 | pub struct RawRef<A, D>(LayoutRef<A, D>);
|
1478 | 1494 |
|
|
0 commit comments