pub struct ArrayViewN<'a, T> { /* private fields */ }Expand description
Immutable dynamic-rank strided view.
Implementations§
Source§impl<'a, T> ArrayViewN<'a, T>
impl<'a, T> ArrayViewN<'a, T>
Sourcepub fn new(
data: &'a [T],
shape: &'a [usize],
strides: &'a [isize],
offset: isize,
) -> Result<Self>
pub fn new( data: &'a [T], shape: &'a [usize], strides: &'a [isize], offset: isize, ) -> Result<Self>
Create a checked 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_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 slice_axis(&self, axis: usize, index: usize) -> Result<Self>
pub fn slice_axis(&self, axis: usize, index: usize) -> Result<Self>
Fix one axis at index, returning a lower-rank view.
Trait Implementations§
Source§impl<'a, T: Clone> Clone for ArrayViewN<'a, T>
impl<'a, T: Clone> Clone for ArrayViewN<'a, T>
Source§fn clone(&self) -> ArrayViewN<'a, T>
fn clone(&self) -> ArrayViewN<'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 moreAuto Trait Implementations§
impl<'a, T> Freeze for ArrayViewN<'a, T>
impl<'a, T> RefUnwindSafe for ArrayViewN<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ArrayViewN<'a, T>where
T: Sync,
impl<'a, T> Sync for ArrayViewN<'a, T>where
T: Sync,
impl<'a, T> Unpin for ArrayViewN<'a, T>
impl<'a, T> UnsafeUnpin for ArrayViewN<'a, T>
impl<'a, T> UnwindSafe for ArrayViewN<'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