25 个版本
使用旧的 Rust 2015
| 0.5.2 | 2023 年 12 月 11 日 |
|---|---|
| 0.5.1 | 2020 年 10 月 7 日 |
| 0.5.0 | 2020 年 9 月 12 日 |
| 0.4.2 | 2018 年 11 月 14 日 |
| 0.1.5 | 2017 年 3 月 31 日 |
#149 在 编码
17,700 每月下载量
用于 32 个crate (12 直接使用)
43KB
902 行
tuple
元组上的逐元素操作!
文档
该crate允许使用宏将操作泛化到元组。请参阅文档中的示例。
功能
impl_num(默认) 添加对(某些)num 特性的支持impl_serde(默认) 添加序列化和反序列化支持(依赖于 serde)impl_simd添加对(某些)simd 类型支持(依赖于 stdsimd 且仅在nightly版本中可用)
支持的运算
TupleElements特性(适用于所有元素类型相同的元组)get和get_mut函数N(元素数量)
运算符Index、IndexMutClone、CopyAdd、AddAssignSub、SubAssignMul、DivNeg
fmt::DebugiterIteratorIterate over all elements at once (assuming they implementIterator). The iterations stops once one or more elements returnNone.
convertFrom和Intotheir tuple equivalent.From和Intotheir array equivalent.TryFromslice
Map<T>特性map: apply a function to each element and return the resulting tuple
- other
rev: reverse the elementsrot_l和rot_r: rotate elementssplit: make two separate tuples out of onejoin: turn two tuples into one
依赖关系
~205KB