@@ -237,7 +237,7 @@ pub type Ixs = isize;
237
237
/// + [Subviews](#subviews)
238
238
/// + [Arithmetic Operations](#arithmetic-operations)
239
239
/// + [Broadcasting](#broadcasting)
240
- /// + [Conversions Between Array Types ](#conversions-between-array-types )
240
+ /// + [Conversions](#conversions)
241
241
/// + [Constructor Methods for Owned Arrays](#constructor-methods-for-owned-arrays)
242
242
/// + [Methods For All Array Types](#methods-for-all-array-types)
243
243
///
@@ -650,7 +650,9 @@ pub type Ixs = isize;
650
650
/// );
651
651
/// ```
652
652
///
653
- /// ## Conversions Between Array Types
653
+ /// ## Conversions
654
+ ///
655
+ /// ### Conversions Between Array Types
654
656
///
655
657
/// This table is a summary of the conversions between arrays of different
656
658
/// ownership, dimensionality, and element type. All of the conversions in this
@@ -851,6 +853,32 @@ pub type Ixs = isize;
851
853
/// </tr>
852
854
/// </table>
853
855
///
856
+ /// ### Conversions Between Arrays and `Vec`s/Slices
857
+ ///
858
+ /// This is a table of the safe conversions between arrays and `Vec`s/slices.
859
+ /// Note that some of the return values are actually `Result`/`Option` wrappers
860
+ /// around the indicated output types.
861
+ ///
862
+ /// Input | Output | Methods
863
+ /// ------|--------|--------
864
+ /// `Vec<A>` | `ArrayBase<S: DataOwned, Ix1>` | [`::from_vec()`](#method.from_vec)
865
+ /// `Vec<A>` | `ArrayBase<S: DataOwned, D>` | [`::from_shape_vec()`](#method.from_shape_vec)
866
+ /// `&[A]` | `ArrayView<A, D>` | [`::from_shape()`](type.ArrayView.html#method.from_shape)
867
+ /// `&mut [A]` | `ArrayViewMut<A, D>` | [`::from_shape()`](type.ArrayViewMut.html#method.from_shape)
868
+ /// `&ArrayBase<S, Ix1>` | `Vec<A>` | [`.to_vec()`](#method.to_vec)
869
+ /// `&ArrayBase<S, D>` | `&[A]` | [`.as_slice()`](#method.as_slice)<sup>[1](#req_contig_std)</sup>, [`.as_slice_memory_order()`](#method.as_slice_memory_order)<sup>[2](#req_contig)</sup>
870
+ /// `&mut ArrayBase<S: DataMut, D>` | `&mut [A]` | [`.as_slice_mut()`](#method.as_slice_mut)<sup>[1](#req_contig_std)</sup>, [`.as_slice_memory_order_mut()`](#method.as_slice_memory_order_mut)<sup>[2](#req_contig)</sup>
871
+ /// `ArrayView<A, D>` | `&[A]` | [`.into_slice()`](type.ArrayView.html#method.into_slice)
872
+ /// `ArrayViewMut<A, D>` | `&mut [A]` | [`.into_slice()`](type.ArrayViewMut.html#method.into_slice)
873
+ ///
874
+ /// <sup><a name="req_contig_std">1</a></sup>Works only if the array is
875
+ /// contiguous and in standard order.
876
+ ///
877
+ /// <sup><a name="req_contig">2</a></sup>Works only if the array is contiguous.
878
+ ///
879
+ /// The table above does not include all the constructors; it only shows
880
+ /// conversions to/from `Vec`s/slices. See below for more constructors.
881
+ ///
854
882
/// [ArrayView::reborrow()]: type.ArrayView.html#method.reborrow
855
883
/// [ArrayViewMut::reborrow()]: type.ArrayViewMut.html#method.reborrow
856
884
/// [.into_dimensionality()]: #method.into_dimensionality
0 commit comments