trait UnzipOp<T>: Sync + Send {
type Left: Send;
type Right: Send;
// Required method
fn consume<FA, FB>(&self, item: T, left: FA, right: FB) -> (FA, FB)
where FA: Folder<Self::Left>,
FB: Folder<Self::Right>;
// Provided method
fn indexable() -> bool { ... }
}
Expand description
This trait abstracts the different ways we can “unzip” one parallel iterator into two distinct consumers, which we can handle almost identically apart from how to process the individual items.