-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tokio::stream::timeout::Timeout is private #2188
Comments
+1 for this, I'd like to be able to store the output type/use it in type definitions. |
If this is as simple as marking the module as public I'm happy to do so. Not sure of the implications of that, very new to tokio. |
Thanks for the feedback. Could you clarify the use cases in which you need to store |
@carllerche in my particular case, I have a struct being a stream and a sink, which wraps an underlying stream and sink. The stream is required to time out if it does not receive a message within a given time frame. This is a perfect use case for the stream timeout function, but the result needs to be stored in the wrapper. |
We discussed this on discord. We would like to make this public, along with the other stream combinators (but not the futures). If you would like to submit a larger PR that marks the combinators as public and puts them in a sub-module of |
Closing in favor of #2723. |
Version
0.2.11
Platform
all
Subcrates
Description
tokio::stream::timeout::Timeout returned by StreamExt::timeout() is private, meaning you can't store the output type anywhere - you can only assign it to a local variable and use type inference, or use dynamic dispatch (which has obvious problems). It's now impossible to store the result e.g. in a struct.
The text was updated successfully, but these errors were encountered: