Skip to content

Commit c63728e

Browse files
committed
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`.
1 parent 3cc93e7 commit c63728e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/body/mod.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@
77
//!
88
//! There are two pieces to this in hyper:
99
//!
10-
//! - The [`Payload`](body::Payload) trait the describes all possible bodies. hyper
11-
//! allows any body type that implements `Payload`, allowing applications to
12-
//! have fine-grained control over their streaming.
13-
//! - The [`Body`](Body) concrete type, which is an implementation of `Payload`,
14-
//! and returned by hyper as a "receive stream" (so, for server requests and
15-
//! client responses). It is also a decent default implementation if you don't
16-
//! have very custom needs of your send streams.
17-
18-
#[doc(hidden)]
10+
//! - The [`HttpBody`](body::HttpBody) trait the describes all possible bodies.
11+
//! hyper allows any body type that implements `HttpBody`, allowing
12+
//! applications to have fine-grained control over their streaming.
13+
//! - The [`Body`](Body) concrete type, which is an implementation of
14+
//! `HttpBody`, and returned by hyper as a "receive stream" (so, for server
15+
//! requests and client responses). It is also a decent default implementation
16+
//! if you don't have very custom needs of your send streams.
17+
1918
pub use http_body::Body as HttpBody;
2019

2120
pub use self::body::{Body, Sender};
2221
pub use self::chunk::Chunk;
23-
pub use self::payload::Payload;
22+
pub(crate) use self::payload::Payload;
2423

2524
mod body;
2625
mod chunk;

0 commit comments

Comments
 (0)