Trait vector2math::Trio [−][src]
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
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
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]
O: Trio,
T: Trio<Item = R>,
F: Fn(Self::Item, O::Item) -> R,
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
Implementations on Foreign Types
impl<T> Trio for (T, T, T)
[src]
type Item = T
fn to_trio(self) -> (Self::Item, Self::Item, Self::Item)
[src]
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self
[src]
impl<T> Trio for [T; 3] where
T: Copy,
[src]
T: Copy,
type Item = T
fn to_trio(self) -> (Self::Item, Self::Item, Self::Item)
[src]
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self
[src]
impl<T> Trio for (T, T, T, T, T, T)
[src]
type Item = (T, T)
fn to_trio(self) -> (Self::Item, Self::Item, Self::Item)
[src]
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self
[src]
impl<T> Trio for [T; 6] where
T: Copy,
[src]
T: Copy,