pub unsafe trait SliceArg<D>: AsRef<[SliceInfoElem]>
where D: Dimension,
{ 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 SliceArg<Dim<IxDynImpl>> for [SliceInfoElem]

source§

impl<T, D> SliceArg<D> for &T
where 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

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, Dim<[usize; 0]>, Dout>
where T: AsRef<[SliceInfoElem]>, Dout: Dimension,

§

type OutDim = Dout

source§

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

§

type OutDim = Dout

source§

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

§

type OutDim = Dout

source§

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

§

type OutDim = Dout

source§

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

§

type OutDim = Dout

source§

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

§

type OutDim = Dout

source§

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

§

type OutDim = Dout