File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,20 @@ type BodySender = mpsc::Sender<Result<Bytes, crate::Error>>;
19
19
type TrailersSender = oneshot:: Sender < HeaderMap > ;
20
20
21
21
/// A stream of `Bytes`, used when receiving bodies from the network.
22
+ ///
23
+ /// Note that Users should not instantiate this struct directly. When working with the hyper client,
24
+ /// `Incoming` is returned to you in responses. Similarly, when operating with the hyper server,
25
+ /// it is provided within requests.
26
+ ///
27
+ /// # Examples
28
+ ///
29
+ /// ```rust,ignore
30
+ /// async fn echo(
31
+ /// req: Request<hyper::body::Incoming>,
32
+ /// ) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
33
+ /// //Here, you can process `Incoming`
34
+ /// }
35
+ /// ```
22
36
#[ must_use = "streams do nothing unless polled" ]
23
37
pub struct Incoming {
24
38
kind : Kind ,
You can’t perform that action at this time.
0 commit comments