tuple
Element wise operations on tuples!
Documentation
This crate allows to generalize operations to tuples using macros. Please look at the Documentation for examples.
Features
impl_num(default) add support for (some) num traitsimpl_serde(default) add support for serialization and deserialization (depends on serde)impl_simdadd support for (some) simd-types (depends on stdsimd and is only available on nightly)
Supported Operations
TupleElementstrait (for tuples where all elements have the same type)getandget_mutfunctionsN(number of elements)
opsIndex,IndexMutClone,CopyAdd,AddAssignSub,SubAssignMul,DivNeg
fmt::DebugiterIteratorIterate over all elements at once (assuming they implementIterator). The iterations stops once one or more elements returnNone.
convertFromandIntotheir tuple equivalent.FromandIntotheir array equivalent.TryFromslice
Map<T>traitmap: apply a function to each element and return the resulting tuple
- other
rev: reverse the elementsrot_landrot_r: rotate elementssplit: make two separate tuples out of onejoin: turn two tuples into one