workers-rs
workers-rs copied to clipboard
[Feature] ObjectBody needs a response_body equivalent when using the http feature
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
Currently ObjectBody.responseBody() is a more CPU efficient way to stream the body of an R2 object, but it uses the "legacy?" ResponseBody structure and no alternative exist for when the http feature is enabled that uses http-body traits.
Maybe exposing a ReadableStream from ObjectBody with some kind of into_inner() that can be used with worker::Body::new() constructor could be the new API.