feat(body): replace the Payload trait with HttpBody
The `hyper::body::HttpBody` trait is a re-export from the `http-body` crate. This allows libraries to accept "HTTP bodies" without needing to depend on hyper. BREAKING CHANGE: All usage of `hyper::body::Payload` should be replaced with `hyper::body::HttpBody`.
This commit is contained in:
@@ -7,20 +7,19 @@
|
|||||||
//!
|
//!
|
||||||
//! There are two pieces to this in hyper:
|
//! There are two pieces to this in hyper:
|
||||||
//!
|
//!
|
||||||
//! - The [`Payload`](body::Payload) trait the describes all possible bodies. hyper
|
//! - The [`HttpBody`](body::HttpBody) trait the describes all possible bodies.
|
||||||
//! allows any body type that implements `Payload`, allowing applications to
|
//! hyper allows any body type that implements `HttpBody`, allowing
|
||||||
//! have fine-grained control over their streaming.
|
//! applications to have fine-grained control over their streaming.
|
||||||
//! - The [`Body`](Body) concrete type, which is an implementation of `Payload`,
|
//! - The [`Body`](Body) concrete type, which is an implementation of
|
||||||
//! and returned by hyper as a "receive stream" (so, for server requests and
|
//! `HttpBody`, and returned by hyper as a "receive stream" (so, for server
|
||||||
//! client responses). It is also a decent default implementation if you don't
|
//! requests and client responses). It is also a decent default implementation
|
||||||
//! have very custom needs of your send streams.
|
//! if you don't have very custom needs of your send streams.
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub use http_body::Body as HttpBody;
|
pub use http_body::Body as HttpBody;
|
||||||
|
|
||||||
pub use self::body::{Body, Sender};
|
pub use self::body::{Body, Sender};
|
||||||
pub use self::chunk::Chunk;
|
pub use self::chunk::Chunk;
|
||||||
pub use self::payload::Payload;
|
pub(crate) use self::payload::Payload;
|
||||||
|
|
||||||
mod body;
|
mod body;
|
||||||
mod chunk;
|
mod chunk;
|
||||||
|
|||||||
Reference in New Issue
Block a user