Proposal: add stream::OptionStream
#2737
Labels
A-stream
Area: futures::stream
C-feature-request
S-needs-api-design
Status: Before implementing this, a discussion or decision on the new API is needed.
Uh oh!
There was an error while loading. Please reload this page.
I would like to propose the addition of a new abstraction:
OptionStream
. I would expect it to have the sameItem
as the underlying stream when it's built from anOption::Some
variant, and to always returnPoll::Pending
Poll::Ready(None)
(see my comment below) when it's built fromOption::None
.The abstraction is useful when you need to enable/disable a particular stream (i.e. an
IntervalStream
) while keeping the same stream type.HereHere you can find a simple implementation, in case it could make things more clear.The text was updated successfully, but these errors were encountered: