Module ops

Module ops 

Source
Expand description

Provides some operations between two tuples.

The module aims to hide the implementation details, all methods are wrapped by TupleLike.

Structs§

PhantomClone
Helper class that indicates types implemented Clone.
PhantomMut
Helper class that indicates mutable references.

Traits§

AsDeref
Convert from &Tuple<T0, T1, T2, ...> to Tuple<&T0::Target, &T1::Target, &T2::Target ..> while all the elements of the tuple implement Deref.
AsDerefMut
Convert from &mut Tuple<T0, T1, T2, ...> to Tuple<&mut T0::Target, &mut T1::Target, &mut T2::Target ..> while all the elements of the tuple implement DerefMut.
Callable
When all elements implement Fn(T) for a specific T, call them once in sequence.
Cloned
Convert from tuple!(&[mut] a, &[mut] b, &[mut] c, ...) to tuple!(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, ...) to tuple!(a, b, c, ...) by copying its elements.
Dot
Dot product operation.
Enumerable
Convert from tuple!(x, y, z, ...) to tuple!((0, x), (1, y), (2, z), ...).
Extendable
If the elements of a tuple are all tuples, push an element to each tuple element.
HeadReplaceable
replace head elements of the tuple.
MutCallable
When all elements implement FnMut(T) for a specific T, call them once in sequence.
OnceCallable
When all elements implement FnOnce(T) for a specific T, call them once in sequence.
Ownedstd or alloc
Convert from tuple!(&[mut] a, &[mut] b, &[mut] c, ...) to tuple!(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.