Struct ndarray::SliceInfo [−][src]
Represents all of the necessary information to perform a slice.
The type T is typically [SliceOrIndex; n], [SliceOrIndex], or
Vec<SliceOrIndex>. The type D is the output dimension after calling
.slice().
Methods
impl<T, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, [src]
impl<T, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>[src]
pub fn new(indices: T) -> Result<SliceInfo<T, D>, ShapeError>Returns a new SliceInfo instance.
Errors if D is not consistent with indices.
impl<T: ?Sized, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, [src]
impl<T: ?Sized, D> SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, pub fn out_ndim(&self) -> usize[src]
pub fn out_ndim(&self) -> usizeReturns the number of dimensions after calling
.slice() (including taking
subviews).
If D is a fixed-size dimension type, then this is equivalent to
D::NDIM.unwrap(). Otherwise, the value is calculated by iterating
over the ranges/indices.
Trait Implementations
impl<T: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>[src]
impl<T: Debug + ?Sized, D: Debug + Dimension> Debug for SliceInfo<T, D>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
D: Dimension, [src]
impl<T: ?Sized, D> Deref for SliceInfo<T, D> where
D: Dimension, type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
fn deref(&self) -> &Self::TargetDereferences the value.
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, [src]
impl<T, D> AsRef<[SliceOrIndex]> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, fn as_ref(&self) -> &[SliceOrIndex][src]
fn as_ref(&self) -> &[SliceOrIndex]Performs the conversion.
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, [src]
impl<T, D> AsRef<SliceInfo<[SliceOrIndex], D>> for SliceInfo<T, D> where
T: AsRef<[SliceOrIndex]>,
D: Dimension, impl<T, D> Copy for SliceInfo<T, D> where
T: Copy,
D: Dimension, [src]
impl<T, D> Copy for SliceInfo<T, D> where
T: Copy,
D: Dimension, impl<T, D> Clone for SliceInfo<T, D> where
T: Clone,
D: Dimension, [src]
impl<T, D> Clone for SliceInfo<T, D> where
T: Clone,
D: Dimension,