Trait tract_hir::internal::tract_ndarray::IntoNdProducer[][src]

pub trait IntoNdProducer {
    type Item;
    type Dim: Dimension;
    type Output: NdProducer;
    pub fn into_producer(self) -> Self::Output;
}

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.

Associated Types

type Item[src]

The element produced per iteration.

type Dim: Dimension[src]

Dimension type of the producer

type Output: NdProducer[src]

Loading content...

Required methods

pub fn into_producer(self) -> Self::Output[src]

Convert the value into an NdProducer.

Loading content...

Implementations on Foreign Types

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

A slice is a one-dimensional producer

type Item = <<&'a [A] as IntoNdProducer>::Output as NdProducer>::Item

type Dim = Dim<[usize; 1]>

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

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

A mutable slice is a mutable one-dimensional producer

Loading content...

Implementors

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

A Vec is a one-dimensional producer

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

type Dim = Dim<[usize; 1]>

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

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

A mutable Vec is a mutable one-dimensional producer

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

type Dim = Dim<[usize; 1]>

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

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

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>

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

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

type Item = &'a mut A

type Dim = D

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

impl<P> IntoNdProducer for P where
    P: NdProducer
[src]

type Item = <P as NdProducer>::Item

type Dim = <P as NdProducer>::Dim

type Output = P

Loading content...