Trait vector2math::Trio[][src]

pub trait Trio: Sized {
    type Item;
    fn to_trio(self) -> (Self::Item, Self::Item, Self::Item);
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self; fn pairwise<O, T, F, R>(self, other: O, ff: F) -> T
    where
        O: Trio,
        T: Trio<Item = R>,
        F: Fn(Self::Item, O::Item) -> R
, { ... }
fn trio_iter(self) -> Chain3<Self::Item> { ... } }

Trait for defining a group of 3 items of the same type.

This trait is meant to generalize having three similar things. It is implemented for (T, T, T) and [T; 3] with Item = T. However, because a trio does not necessarily have to be an actual tuple It is also implemented for (T, T, T, T, T, T) and [T; 6] with Item = (T, T, T) and Item = [T; 3] respectively.

Associated Types

type Item[src]

The type of the trio's item

Loading content...

Required methods

fn to_trio(self) -> (Self::Item, Self::Item, Self::Item)[src]

Get the trio

fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self[src]

Create a trio from three items

Loading content...

Provided methods

fn pairwise<O, T, F, R>(self, other: O, ff: F) -> T where
    O: Trio,
    T: Trio<Item = R>,
    F: Fn(Self::Item, O::Item) -> R, 
[src]

Apply a function pairwise to the items of two trios

fn trio_iter(self) -> Chain3<Self::Item>[src]

Get an iterator over the trio's items

Loading content...

Implementations on Foreign Types

impl<T> Trio for (T, T, T)[src]

type Item = T

impl<T> Trio for [T; 3] where
    T: Copy
[src]

type Item = T

impl<T> Trio for (T, T, T, T, T, T)[src]

type Item = (T, T)

impl<T> Trio for [T; 6] where
    T: Copy
[src]

type Item = [T; 2]

Loading content...

Implementors

Loading content...