Skip to content

Commit

Permalink
feat(body): replace the Payload trait with HttpBody
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
seanmonstar committed Dec 4, 2019
1 parent 3cc93e7 commit c63728e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/body/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@
//!
//! There are two pieces to this in hyper:
//!
//! - The [`Payload`](body::Payload) trait the describes all possible bodies. hyper
//! allows any body type that implements `Payload`, allowing applications to
//! have fine-grained control over their streaming.
//! - The [`Body`](Body) concrete type, which is an implementation of `Payload`,
//! and returned by hyper as a "receive stream" (so, for server requests and
//! client responses). It is also a decent default implementation if you don't
//! have very custom needs of your send streams.
#[doc(hidden)]
//! - The [`HttpBody`](body::HttpBody) trait the describes all possible bodies.
//! hyper allows any body type that implements `HttpBody`, allowing
//! applications to have fine-grained control over their streaming.
//! - The [`Body`](Body) concrete type, which is an implementation of
//! `HttpBody`, and returned by hyper as a "receive stream" (so, for server
//! requests and client responses). It is also a decent default implementation
//! if you don't have very custom needs of your send streams.
pub use http_body::Body as HttpBody;

pub use self::body::{Body, Sender};
pub use self::chunk::Chunk;
pub use self::payload::Payload;
pub(crate) use self::payload::Payload;

mod body;
mod chunk;
Expand Down

0 comments on commit c63728e

Please sign in to comment.