Skip to content

Commit

Permalink
doc(body:incoming): reference http-body-incoming for more explain
Browse files Browse the repository at this point in the history
doc(body:incoming): reference http-body-incoming for more explain:update

doc(body:incoming): reference http-body-incoming for more explain:delete .vscode
  • Loading branch information
ZhangHanDong committed Nov 8, 2023
1 parent 429ad8a commit 0dbd90d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/body/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ type BodySender = mpsc::Sender<Result<Bytes, crate::Error>>;
type TrailersSender = oneshot::Sender<HeaderMap>;

/// A stream of `Bytes`, used when receiving bodies from the network.
///
/// Note that Users should not instantiate this struct directly. When working with the hyper client,
/// `Incoming` is returned to you in responses. Similarly, when operating with the hyper server,
/// it is provided within requests.
///
/// # Examples
///
/// ```rust,ignore
/// async fn echo(
/// req: Request<hyper::body::Incoming>,
/// ) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
/// //Here, you can process `Incoming`
/// }
/// ```
#[must_use = "streams do nothing unless polled"]
pub struct Incoming {
kind: Kind,
Expand Down

0 comments on commit 0dbd90d

Please sign in to comment.