Add TaskLocalFuture::into_value
#5743
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-task
Module: tokio/task
Is your feature request related to a problem? Please describe.
Sometimes we want to use
LocalKey
withStream
, and it's impossible to yield from an async closure. A workaround is wrap inside the stream iteration:However, the
scope
will take the ownership of the slot value, and compile failed.Describe the solution you'd like
I hope we can add a method to return the ownership of slot value instead of always dropping it, so that we can:
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Directly support Stream, such as
LocalKey::scope_stream
.Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: