pub struct ArrayView3<'a, T> { /* private fields */ }Expand description
Immutable 3D array view.
Implementations§
Source§impl<'a, T> ArrayView3<'a, T>
impl<'a, T> ArrayView3<'a, T>
Sourcepub fn new(
data: &'a [T],
shape: [usize; 3],
strides: [isize; 3],
offset: isize,
) -> Result<Self>
pub fn new( data: &'a [T], shape: [usize; 3], strides: [isize; 3], offset: isize, ) -> Result<Self>
Create a checked immutable view.
Sourcepub fn is_contiguous(&self) -> bool
pub fn is_contiguous(&self) -> bool
Whether the view is compact row-major contiguous.
Sourcepub fn as_slice(&self) -> Option<&'a [T]>
pub fn as_slice(&self) -> Option<&'a [T]>
Borrow the backing slice if this view covers it contiguously.
Sourcepub fn matrix_at(&self, axis: usize, index: usize) -> Result<ArrayView2<'a, T>>
pub fn matrix_at(&self, axis: usize, index: usize) -> Result<ArrayView2<'a, T>>
Extract a 2D matrix view by fixing one axis.
Sourcepub fn for_each_matrix(
&self,
axis: usize,
f: impl FnMut(usize, ArrayView2<'a, T>) -> Result<()>,
) -> Result<()>
pub fn for_each_matrix( &self, axis: usize, f: impl FnMut(usize, ArrayView2<'a, T>) -> Result<()>, ) -> Result<()>
Visit each 2D matrix slice along axis in order.
Trait Implementations§
Source§impl<'a, T: Clone> Clone for ArrayView3<'a, T>
impl<'a, T: Clone> Clone for ArrayView3<'a, T>
Source§fn clone(&self) -> ArrayView3<'a, T>
fn clone(&self) -> ArrayView3<'a, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, T: Debug> Debug for ArrayView3<'a, T>
impl<'a, T: Debug> Debug for ArrayView3<'a, T>
impl<'a, T: Copy> Copy for ArrayView3<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ArrayView3<'a, T>
impl<'a, T> RefUnwindSafe for ArrayView3<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ArrayView3<'a, T>where
T: Sync,
impl<'a, T> Sync for ArrayView3<'a, T>where
T: Sync,
impl<'a, T> Unpin for ArrayView3<'a, T>
impl<'a, T> UnsafeUnpin for ArrayView3<'a, T>
impl<'a, T> UnwindSafe for ArrayView3<'a, T>where
T: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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