Skip to content
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

Make Response::bytes_stream return a concrete type #2429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

its-the-shrimp
Copy link

in my project I needed to store the resulting stream to avoid an allocation, but the fact that the method returns an impl Stream means that it wasn't possible to do so without boxing it

@seanmonstar
Copy link
Owner

Thanks for the PR! But I'm not going to expose a named type for this method.

You can store it by boxing it, as one option. But you said you don't want to allocate. So you could also just store the Response, or put it in a newtype and pull out a chunk in a Stream impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants