Expand description
Provides some operations between two tuples.
The module aims to hide the implementation details, all methods are wrapped by TupleLike
.
Structs§
- Helper class that indicates types implemented
Clone
. - Helper class that indicates mutable references.
Traits§
- Convert from
&Tuple<T0, T1, T2, ...>
toTuple<&T0::Target, &T1::Target, &T2::Target ..>
while all the elements of the tuple implementDeref
. - Convert from
&mut Tuple<T0, T1, T2, ...>
toTuple<&mut T0::Target, &mut T1::Target, &mut T2::Target ..>
while all the elements of the tuple implementDerefMut
. - When all elements implement
Fn(T)
for a specificT
, call them once in sequence. - Convert from
tuple!(&[mut] a, &[mut] b, &[mut] c, ...)
totuple!(a, b, c, ...)
by cloning its elements. - If two tuples have the same number of elements, and their elements are both tuples, join their tuple elements one-to-one.
- Convert from
tuple!(&[mut] a, &[mut] b, &[mut] c, ...)
totuple!(a, b, c, ...)
by copying its elements. - Dot product operation.
- Convert from
tuple!(x, y, z, ...)
totuple!((0, x), (1, y), (2, z), ...)
. - If the elements of a tuple are all tuples, push an element to each tuple element.
- replace head elements of the tuple.
- When all elements implement
FnMut(T)
for a specificT
, call them once in sequence. - When all elements implement
FnOnce(T)
for a specificT
, call them once in sequence. - Owned
std
oralloc
Convert fromtuple!(&[mut] a, &[mut] b, &[mut] c, ...)
totuple!(a, b, c, ...)
by cloning its elements. - Pop elements from the front and back of the tuple.
- Rotate the elements of the tuple.
- If the elements of a tuple are all tuples, pop an element from each tuple element.
- Opposite operation of
to_tuple()
. - Unzip a tuple to two tuples, if all elements of the tuple are tuples with two elements.
- Zip two tuples.