pub struct StridedArray2DViewMut<'a, T> { /* private fields */ }
Expand description
A mutable view of an 2D array in row-major order that allows for parallel processing of vertical slices.
Implementations§
Source§impl<'a, T> StridedArray2DViewMut<'a, T>
impl<'a, T> StridedArray2DViewMut<'a, T>
Sourcepub const fn without_stride(
data: &'a mut [T],
height: usize,
width: usize,
) -> Result<Self, Error>
pub const fn without_stride( data: &'a mut [T], height: usize, width: usize, ) -> Result<Self, Error>
Create a single-piece view of the data.
Sourcepub unsafe fn get_unchecked_ref(&self, i: usize, j: usize) -> &T
pub unsafe fn get_unchecked_ref(&self, i: usize, j: usize) -> &T
Returns a reference to the data at the given indices without bounds checking.
§Safety
The caller must ensure that i < self.height
and j < self.width()
.
Sourcepub unsafe fn get_unchecked_mut(&mut self, i: usize, j: usize) -> &mut T
pub unsafe fn get_unchecked_mut(&mut self, i: usize, j: usize) -> &mut T
Returns a mutable reference to the data at the given indices without bounds checking.
§Safety
The caller must ensure that i < self.height
and j < self.width()
.
pub const fn height(&self) -> usize
pub const fn width(&self) -> usize
Sourcepub fn iter_column_mut(
&mut self,
col: usize,
) -> impl Iterator<Item = &mut T> + '_
pub fn iter_column_mut( &mut self, col: usize, ) -> impl Iterator<Item = &mut T> + '_
Iterate over the mutable references to the elements in the specified column.
Sourcepub fn into_strides(self, stride: usize) -> impl Iterator<Item = Self> + 'a
pub fn into_strides(self, stride: usize) -> impl Iterator<Item = Self> + 'a
Returns iterator over vertical slices of the data for the given stride.
Sourcepub fn into_par_strides(
self,
stride: usize,
) -> impl ParallelIterator<Item = Self> + 'a
pub fn into_par_strides( self, stride: usize, ) -> impl ParallelIterator<Item = Self> + 'a
Returns parallel iterator over vertical slices of the data for the given stride.
Trait Implementations§
Source§impl<'a, T: Debug> Debug for StridedArray2DViewMut<'a, T>
impl<'a, T: Debug> Debug for StridedArray2DViewMut<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for StridedArray2DViewMut<'a, T>
impl<'a, T> RefUnwindSafe for StridedArray2DViewMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StridedArray2DViewMut<'a, T>where
T: Send,
impl<'a, T> Sync for StridedArray2DViewMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for StridedArray2DViewMut<'a, T>
impl<'a, T> !UnwindSafe for StridedArray2DViewMut<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more