Trait vector2math::Trio
source · pub trait Trio: Sized {
type Item;
// Required methods
fn into_trio(self) -> (Self::Item, Self::Item, Self::Item);
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self;
// 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 { ... }
fn trio_iter(self) -> Chain3<Self::Item> { ... }
}
Expand description
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.
Required Associated Types§
Required Methods§
sourcefn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self
fn from_items(a: Self::Item, b: Self::Item, c: Self::Item) -> Self
Create a trio from three items