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