You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is better than the nested tuple approach of non-trait based zip.
Design
pubtraitZip{/// What's the return type of our stream?typeItem;/// What stream do we return?typeStream:Stream<Item = Self::Item>;/// Combine multiple streams into a single stream.fnzip(self) -> Self::Stream;}
For the Zip variant: we may want to skip directly ahead to #22 in terms of implementation, creating an output slot of Container[MaybUninit<T>] where we write into, and then mem::swap on each iteration.
Metadata would need to be stored in an accompanying PollState slot. The main things to keep an eye will be to:
ensure to implement the PinnedDrop trait to drop memory in the case of a cancellation
switch between PollState::Pending and PollState::Ready while data is actively being yielded, and only switch to PollState::Consume at the end.
The semantics of Zip are that if at any point one of the streams yields Poll::Ready(None), all other streams are cancelled. We should create a case where one stream yields more times than the other streams so that we can exercise miri's checkers during CI.
This is a core iteration "order of execution" operation, enabling people to author:
after
This is better than the nested tuple approach of non-trait based
zip
.Design
Tasks
Zip
trait Init zip and chain traits #73impl Zip for vec
trait Init zip and chain traits #73impl Zip for array
trait Init zip and chain traits #73impl Zip for tuple
The text was updated successfully, but these errors were encountered: