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