extendr_api::prelude

Trait SliceArg

Source
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,

Source§

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,

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout

Source§

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

Source§

type OutDim = Dout