Trait ndarray::SliceArg

source ·
pub unsafe trait SliceArg<D: Dimension>: AsRef<[SliceInfoElem]> {
    type OutDim: Dimension;

    // Required methods
    fn in_ndim(&self) -> usize;
    fn out_ndim(&self) -> usize;
}
Expand description

A type that can slice an array of dimension D.

This trait is unsafe to implement because the implementation must ensure that D, Self::OutDim, self.in_dim(), and self.out_ndim() are consistent with the &[SliceInfoElem] returned by self.as_ref() and that self.as_ref() always returns the same value when called multiple times.

Required Associated Types§

source

type OutDim: Dimension

Dimensionality of the output array.

Required Methods§

source

fn in_ndim(&self) -> usize

Returns the number of axes in the input array.

source

fn out_ndim(&self) -> usize

Returns the number of axes in the output array.

Implementations on Foreign Types§

source§

impl<T, D> SliceArg<D> for &Twhere T: SliceArg<D> + ?Sized, D: Dimension,

§

type OutDim = <T as SliceArg<D>>::OutDim

source§

fn in_ndim(&self) -> usize

source§

fn out_ndim(&self) -> usize

source§

impl SliceArg<Dim<IxDynImpl>> for [SliceInfoElem]

Implementors§

source§

impl<T, Din, Dout> SliceArg<Dim<IxDynImpl>> for SliceInfo<T, Din, Dout>where T: AsRef<[SliceInfoElem]>, Din: Dimension, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 0]>> for SliceInfo<T, Ix0, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 1]>> for SliceInfo<T, Ix1, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 2]>> for SliceInfo<T, Ix2, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 3]>> for SliceInfo<T, Ix3, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 4]>> for SliceInfo<T, Ix4, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 5]>> for SliceInfo<T, Ix5, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

impl<T, Dout> SliceArg<Dim<[usize; 6]>> for SliceInfo<T, Ix6, Dout>where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout