http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.46k stars 120 forks source link

Request, Response: inner types as_ref/mut #197

Closed Fishrock123 closed 4 years ago

Fishrock123 commented 4 years ago

Allows access to the underlying Request or Response by reference, including mutably.

Mirrors Tide's api for this. (See https://github.com/http-rs/tide/commit/2024ed22f5e828974fd4f0806e7ffbeee8cae476)

This (mutable reference) will be necessary in order to have https://github.com/http-rs/surf/pull/195 on top of https://github.com/http-rs/surf/pull/194 without adding another specialized public api for adjusting the url.

(semver-major due to removing Request.request() in favor of Request.into::<http::Request>().)