Trait dfdx::data::Collate

source ·
pub trait Collate {
    type Collated;

    // Required method
    fn collated(self) -> Self::Collated;
}
Expand description

Collates Self into some other type. Generally similar to an unzip method; Transforms [(A, B); N] into ([A; N], [B; N]); Transforms Vec<(A, B)> into (Vec<A>, Vec<B>).

Required Associated Types§

Required Methods§

source

fn collated(self) -> Self::Collated

Implementations on Foreign Types§

source§

impl<'a, A, B> Collate for Vec<&'a (A, B)>

source§

impl<A, B, const N: usize> Collate for [(A, B); N]

§

type Collated = ([A; N], [B; N])

source§

fn collated(self) -> Self::Collated

source§

impl<A, B> Collate for Vec<(A, B)>

§

type Collated = (Vec<A, Global>, Vec<B, Global>)

source§

fn collated(self) -> Self::Collated

source§

impl<'a, A, B, const N: usize> Collate for [&'a (A, B); N]

§

type Collated = ([&'a A; N], [&'a B; N])

source§

fn collated(self) -> Self::Collated

Implementors§