mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Add StreamBody (#237)
This adds `StreamBody` which converts a `Stream` of `Bytes` into a `http_body::Body`. --- As suggested by Kestrer on Discord it would make sense for axum to provide different kinds of body types other than `Empty`, `Full`, and `hyper::Body`. There is also some talk about [splitting up `hyper::Body`](https://github.com/hyperium/hyper/issues/2345) so this can be seen as getting started on that effort. axum's body types could be moved to hyper or http-body if thats the direction we decide on. The types I'm thinking about adding are: - `StreamBody`- added in this PR - `AsyncReadBody` - similar to [http-body#41](https://github.com/hyperium/http-body/pull/41/files) - `ChannelBody` - similar to `hyper::Body::channel`
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
use crate::BoxError;
|
||||
use crate::Error;
|
||||
|
||||
mod stream_body;
|
||||
|
||||
pub use self::stream_body::StreamBody;
|
||||
|
||||
#[doc(no_inline)]
|
||||
pub use http_body::{Body as HttpBody, Empty, Full};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user