pub trait IntoNdProducer {
    type Item;
    type Dim: Dimension;
    type Output: NdProducer<Dim = Self::Dim, Item = Self::Item>;

    // Required method
    fn into_producer(self) -> Self::Output;
}
Expand description

Argument conversion into a producer.

Slices and vectors can be used (equivalent to 1-dimensional array views).

This trait is like IntoIterator for NdProducers instead of iterators.

Required Associated Types§

source

type Item

The element produced per iteration.

source

type Dim: Dimension

Dimension type of the producer

source

type Output: NdProducer<Dim = Self::Dim, Item = Self::Item>

Required Methods§

source

fn into_producer(self) -> Self::Output

Convert the value into an NdProducer.

Implementations on Foreign Types§

source§

impl<'a, A> IntoNdProducer for &'a [A]
where A: 'a,

A slice is a one-dimensional producer

source§

impl<'a, A> IntoNdProducer for &'a Vec<A>
where A: 'a,

A Vec is a one-dimensional producer

source§

impl<'a, A> IntoNdProducer for &'a mut [A]
where A: 'a,

A mutable slice is a mutable one-dimensional producer

source§

impl<'a, A> IntoNdProducer for &'a mut Vec<A>
where A: 'a,

A mutable Vec is a mutable one-dimensional producer

§

type Item = <<&'a mut Vec<A> as IntoNdProducer>::Output as NdProducer>::Item

§

type Dim = Dim<[usize; 1]>

§

type Output = ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 1]>>

source§

fn into_producer(self) -> <&'a mut Vec<A> as IntoNdProducer>::Output

Implementors§

source§

impl<'a, A, S, D> IntoNdProducer for &'a ArrayBase<S, D>
where A: 'a, D: Dimension, S: Data<Elem = A>,

An array reference is an n-dimensional producer of element references (like ArrayView).

§

type Item = &'a A

§

type Dim = D

§

type Output = ArrayBase<ViewRepr<&'a A>, D>

source§

impl<'a, A, S, D> IntoNdProducer for &'a mut ArrayBase<S, D>
where A: 'a, D: Dimension, S: DataMut<Elem = A>,

A mutable array reference is an n-dimensional producer of mutable element references (like ArrayViewMut).

source§

impl<P> IntoNdProducer for P
where P: NdProducer,

§

type Item = <P as NdProducer>::Item

§

type Dim = <P as NdProducer>::Dim

§

type Output = P