pub struct ArrayViewMutN<'a, T> { /* private fields */ }Expand description
Mutable dynamic-rank strided view.
Implementations§
Source§impl<'a, T> ArrayViewMutN<'a, T>
impl<'a, T> ArrayViewMutN<'a, T>
Sourcepub fn new(
data: &'a mut [T],
shape: Vec<usize>,
strides: Vec<isize>,
offset: isize,
) -> Result<Self>
pub fn new( data: &'a mut [T], shape: Vec<usize>, strides: Vec<isize>, offset: isize, ) -> Result<Self>
Create a checked mutable dynamic-rank view.
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Whether the view is compact row-major contiguous.
Sourcepub fn as_mut_slice(&mut self) -> Option<&mut [T]>
pub fn as_mut_slice(&mut self) -> Option<&mut [T]>
Borrow the backing slice if this view covers it contiguously.
Sourcepub fn as_view(&self) -> ArrayViewN<'_, T>
pub fn as_view(&self) -> ArrayViewN<'_, T>
Immutable view over the same region.
Sourcepub fn slice_axis_mut(
&mut self,
axis: usize,
index: usize,
) -> Result<ArrayViewMutN<'_, T>>
pub fn slice_axis_mut( &mut self, axis: usize, index: usize, ) -> Result<ArrayViewMutN<'_, T>>
Fix one axis at index, returning a lower-rank mutable view.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ArrayViewMutN<'a, T>
impl<'a, T> RefUnwindSafe for ArrayViewMutN<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ArrayViewMutN<'a, T>where
T: Send,
impl<'a, T> Sync for ArrayViewMutN<'a, T>where
T: Sync,
impl<'a, T> Unpin for ArrayViewMutN<'a, T>
impl<'a, T> UnsafeUnpin for ArrayViewMutN<'a, T>
impl<'a, T> !UnwindSafe for ArrayViewMutN<'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