Create a new `Response` instance.
(mut response: wreq::Response)
| 29 | impl Response { |
| 30 | /// Create a new `Response` instance. |
| 31 | pub fn new(mut response: wreq::Response) -> Self { |
| 32 | Response { |
| 33 | url: response.url().clone(), |
| 34 | version: Version::from_ffi(response.version()), |
| 35 | status_code: StatusCode::from(response.status()), |
| 36 | remote_addr: response.remote_addr().map(SocketAddr), |
| 37 | content_length: response.content_length(), |
| 38 | headers: HeaderMap(std::mem::take(response.headers_mut())), |
| 39 | response: ArcSwapOption::from_pointee(response), |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /// Consumes the `Response` and returns the inner `wreq::Response`. |
| 44 | pub fn inner(&self) -> PyResult<wreq::Response> { |
nothing calls this directly
no test coverage detected