Create from a fully-buffered [`ProxyResponse`] (for mock routes).
(resp: ProxyResponse)
| 85 | impl StreamingProxyResponse { |
| 86 | /// Create from a fully-buffered [`ProxyResponse`] (for mock routes). |
| 87 | pub fn from_buffered(resp: ProxyResponse) -> Self { |
| 88 | Self { |
| 89 | status: resp.status, |
| 90 | headers: resp.headers, |
| 91 | body: StreamingBody::Buffered(Some(resp.body)), |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /// Read the next body chunk. Returns `None` when the body is exhausted. |
| 96 | pub async fn next_chunk(&mut self) -> Result<Option<bytes::Bytes>, RouterError> { |
nothing calls this directly
no outgoing calls
no test coverage detected