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
Turns out what I want here can just be acheived with futures::future::OptionFuture. The FusedFuture abstraction provides is_terminated, and it works great with both tokio and futures select macros.
Is your feature request related to a problem? Please describe.
Using
select!
macro withOption<T> where T: Future
is not ergonomic:Describe the solution you'd like
Would be great if we provide a simple adapter for the
Option<T> where T: Future
, outlined with pseudocode below:This would really be something like a
OptionExt
trait, but you get the idea.With this, we can do it more elegantly, and without an error:
Describe alternatives you've considered
Altering the
select!
macro to supportOption
s would be an alternative, but it's more involving.Additional context
None
The text was updated successfully, but these errors were encountered: