-
Notifications
You must be signed in to change notification settings - Fork 655
Open
Labels
A-streamArea: futures::streamArea: futures::streamC-feature-requestS-needs-api-designStatus: Before implementing this, a discussion or decision on the new API is needed.Status: Before implementing this, a discussion or decision on the new API is needed.
Description
I would like to propose the addition of a new abstraction: OptionStream
. I would expect it to have the same Item
as the underlying stream when it's built from an Option::Some
variant, and to always return Poll::Pending
Poll::Ready(None)
(see my comment below) when it's built from Option::None
.
The abstraction is useful when you need to enable/disable a particular stream (i.e. an IntervalStream
) while keeping the same stream type.
Here Here you can find a simple implementation, in case it could make things more clear.
lu-zero
Metadata
Metadata
Assignees
Labels
A-streamArea: futures::streamArea: futures::streamC-feature-requestS-needs-api-designStatus: Before implementing this, a discussion or decision on the new API is needed.Status: Before implementing this, a discussion or decision on the new API is needed.