Create a new `Body` stream with associated Sender half.
()
| 70 | |
| 71 | /// Create a new `Body` stream with associated Sender half. |
| 72 | pub fn channel() -> (Sender, Body) { |
| 73 | let (sender, body) = channel::channel(); |
| 74 | (sender, Body::new(body)) |
| 75 | } |
| 76 | |
| 77 | /// Collect the body into `Bytes` |
| 78 | pub async fn collect(self) -> Result<Collected<Bytes>, Error> { |