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
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:
The body::Inner enum had a new variant Stream(Box<Stream<Chunk, Error>>)
Body's poll() impl had a new branch Stream(stream) => stream.poll()
Body had a new constructor Body::stream(stream)
The text was updated successfully, but these errors were encountered:
btw, even now on 0.11.x, you don't have to use Body at all; you can instead use something like hyper::Response<Box<Stream<Item = Vec<u8>, Error = Error> + Send>>. The downside is that you may be giving up compatibility with libraries/frameworks that expect Body.
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: