-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Create Body from Stream #1468
Comments
I think you're in luck. (And me; I've been wanting this too.) Looks like 0.12.x is going to add it. See |
btw, even now on 0.11.x, you don't have to use |
Sweet, thanks for illuminating. I look forward to trying 0.12.x. |
Body implements Stream, but there doesn't seem to be a simple way to turn a chunk stream back into a Body.
For example, the most obvious gzip middleware would look like this:
But as far as I can tell, the only tool Body gives us is
Body::pair()
so I suppose we do something like this:It's not very user friendly. Nor am I sure if I implemented that correctly. It doesn't seem like the right abstraction for when you just want to transform the chunk stream.
For example, imagine if:
Stream(Box<Stream<Chunk, Error>>)
Stream(stream) => stream.poll()
Body::stream(stream)
The text was updated successfully, but these errors were encountered: