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
I think it is more useful for http-body to have something like hyper::Body::wrap_stream, with which you can trivially wrap tokio_util::io::ReaderStream to convert an impl AsyncRead to an impl Body.
In tower-http we have an adapter that makes an
AsyncRead
into aBody
https://github.com/tower-rs/tower-http/blob/serve-file/tower-http/src/serve_file.rs#L107. Is that something you'd be interested in upstreaming to http-body? Might be useful for others.Adapters for
Stream<Item = Bytes>
andStream<Item = Vec<u8>>
might also be nice.If you're interested I can submit a PR.
The text was updated successfully, but these errors were encountered: