Trait tract_core::internal::tract_ndarray::IntoNdProducer
source · [−]pub trait IntoNdProducer {
type Item;
type Dim: Dimension;
type Output: NdProducer
where
<Self::Output as NdProducer>::Dim == Self::Dim,
<Self::Output as NdProducer>::Item == Self::Item;
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
type Output: NdProducer
where
<Self::Output as NdProducer>::Dim == Self::Dim,
<Self::Output as NdProducer>::Item == Self::Item
Required Methods
fn into_producer(self) -> Self::Output
fn into_producer(self) -> Self::Output
Convert the value into an NdProducer.
Implementations on Foreign Types
sourceimpl<'a, A> IntoNdProducer for &'a mut [A] where
A: 'a,
impl<'a, A> IntoNdProducer for &'a mut [A] where
A: 'a,
A mutable slice is a mutable one-dimensional producer
type Item = <<&'a mut [A] as IntoNdProducer>::Output as NdProducer>::Item
type Dim = Dim<[usize; 1]>
type Output = ArrayBase<ViewRepr<&'a mut A>, Dim<[usize; 1]>>
fn into_producer(self) -> <&'a mut [A] as IntoNdProducer>::OutputⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
sourceimpl<'a, A> IntoNdProducer for &'a [A] where
A: 'a,
impl<'a, A> IntoNdProducer for &'a [A] where
A: 'a,
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]>>
fn into_producer(self) -> <&'a [A] as IntoNdProducer>::OutputⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Implementors
sourceimpl<'a, A> IntoNdProducer for &'a Vec<A, Global> where
A: 'a,
impl<'a, A> IntoNdProducer for &'a Vec<A, Global> where
A: 'a,
A Vec is a one-dimensional producer
sourceimpl<'a, A> IntoNdProducer for &'a mut Vec<A, Global> where
A: 'a,
impl<'a, A> IntoNdProducer for &'a mut Vec<A, Global> where
A: 'a,
A mutable Vec is a mutable one-dimensional producer
sourceimpl<'a, A, S, D> IntoNdProducer for &'a ArrayBase<S, D> where
A: 'a,
D: Dimension,
S: Data<Elem = A>,
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).
sourceimpl<'a, A, S, D> IntoNdProducer for &'a mut ArrayBase<S, D> where
A: 'a,
D: Dimension,
S: DataMut<Elem = A>,
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).