@@ -599,6 +599,9 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
599
599
600
600
/// Return the array’s data as a slice, if it is contiguous and
601
601
/// the element order corresponds to the memory order. Return `None` otherwise.
602
+ ///
603
+ /// If this function returns `Some(_)`, then the element order in the slice
604
+ /// corresponds to the local order of the array’s elements.
602
605
pub fn as_slice ( & self ) -> Option < & [ A ] > {
603
606
if self . is_standard_layout ( ) {
604
607
unsafe {
@@ -626,7 +629,12 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
626
629
627
630
/// Return the array’s data as a slice if it is contiguous,
628
631
/// return `None` otherwise.
629
- pub fn as_slice_no_order ( & self ) -> Option < & [ A ] > {
632
+ ///
633
+ /// If this function returns `Some(_)`, then the elements in the slice
634
+ /// have whatever order the elements have in memory.
635
+ ///
636
+ /// Implementation notes: Does not yet support negatively strided arrays.
637
+ pub fn as_slice_any_order ( & self ) -> Option < & [ A ] > {
630
638
if self . is_contiguous ( ) {
631
639
unsafe {
632
640
Some ( slice:: from_raw_parts ( self . ptr , self . len ( ) ) )
@@ -638,7 +646,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
638
646
639
647
/// Return the array’s data as a slice if it is contiguous,
640
648
/// return `None` otherwise.
641
- pub fn as_slice_mut_no_order ( & mut self ) -> Option < & mut [ A ] >
649
+ pub fn as_slice_any_order_mut ( & mut self ) -> Option < & mut [ A ] >
642
650
where S : DataMut
643
651
{
644
652
if self . is_contiguous ( ) {
0 commit comments