From 0dbd90d2e4c7907a0a594c69b1f5c3fd1087c9dd Mon Sep 17 00:00:00 2001 From: blackanger Date: Fri, 3 Nov 2023 11:48:29 +0800 Subject: [PATCH] doc(body:incoming): reference http-body-incoming for more explain doc(body:incoming): reference http-body-incoming for more explain:update doc(body:incoming): reference http-body-incoming for more explain:delete .vscode --- src/body/incoming.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/body/incoming.rs b/src/body/incoming.rs index ad5bd16116..c9300691eb 100644 --- a/src/body/incoming.rs +++ b/src/body/incoming.rs @@ -19,6 +19,20 @@ type BodySender = mpsc::Sender>; type TrailersSender = oneshot::Sender; /// 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, +/// ) -> Result>, hyper::Error> { +/// //Here, you can process `Incoming` +/// } +/// ``` #[must_use = "streams do nothing unless polled"] pub struct Incoming { kind: Kind,