pub trait Zippable<T>: TupleLike {
type ZipOutput: TupleLike;
type ZipOutput2: TupleLike;
// Required methods
fn zip(self, rhs: T) -> Self::ZipOutput;
fn zip2(self, rhs: T) -> Self::ZipOutput2;
}Expand description
Zip two tuples.
Required Associated Types§
Sourcetype ZipOutput2: TupleLike
type ZipOutput2: TupleLike
The type of the output generated by zipping two tuples, but elements are primitive tuples.
Required Methods§
Sourcefn zip2(self, rhs: T) -> Self::ZipOutput2
fn zip2(self, rhs: T) -> Self::ZipOutput2
Zip two tuples, but output elements are primitive tuples.
Hint: The TupleLike trait provides the zip2() method as the wrapper
for this zip2() method.
§Example
use tuplez::{tuple, TupleLike};
let tup = tuple!(1, 2.0, "3").zip2(tuple!("4", 5, 6.0));
assert_eq!(tup, tuple!((1, "4"), (2.0, 5), ("3", 6.0)));Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.