Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,15 @@ where
}

/// Return a mutable pointer to the first element in the array.
///
/// This method attempts to unshare the data. If `S: DataMut`, then the
/// data is guaranteed to be uniquely held on return.
///
/// # Warning
///
/// When accessing elements through this pointer, make sure to use strides
/// obtained *after* calling this method, since the process of unsharing
/// the data may change the strides.
#[inline(always)]
pub fn as_mut_ptr(&mut self) -> *mut A
where
Expand All @@ -1462,6 +1471,9 @@ where
}

/// Return a raw mutable view of the array.
///
/// This method attempts to unshare the data. If `S: DataMut`, then the
/// data is guaranteed to be uniquely held on return.
#[inline]
pub fn raw_view_mut(&mut self) -> RawArrayViewMut<A, D>
where
Expand Down