(prev_status: u16, method: &Method)
| 628 | |
| 629 | struct StreamingBody { |
| 630 | rx: tokio::sync::mpsc::Receiver<Bytes>, |
| 631 | } |
| 632 | |
| 633 | impl http_body::Body for StreamingBody { |
| 634 | type Data = Bytes; |
| 635 | type Error = Infallible; |
| 636 | |
| 637 | fn poll_frame( |
| 638 | mut self: Pin<&mut Self>, |
| 639 | cx: &mut Context<'_>, |
| 640 | ) -> Poll<Option<std::result::Result<http_body::Frame<Self::Data>, Self::Error>>> { |
| 641 | match self.rx.poll_recv(cx) { |
| 642 | Poll::Ready(Some(bytes)) => Poll::Ready(Some(Ok(http_body::Frame::data(bytes)))), |
| 643 | Poll::Ready(None) => Poll::Ready(None), |