Repository: seanmonstar/reqwest (language: rust)

Issue:
Consider exposing http::Extensions in reqwest::Response
Having access to `http::Extensions` could be useful when there is a need to store some metadata regarding a specific response. I think it would suffice to have the same functions as hyper i.e [`extensions()`](https://docs.rs/hyper/0.14.17/hyper/struct.Response.html#method.extensions) and [`extensions_mut()`](https://docs.rs/hyper/0.14.17/hyper/struct.Response.html#method.extensions_mut) on `reqwest::Response`.


Discussion / hints:

Fix patch:
diff --git a/src/async_impl/response.rs b/src/async_impl/response.rs
index b12b2c268..33d859ed4 100644
--- a/src/async_impl/response.rs
+++ b/src/async_impl/response.rs
@@ -122,6 +122,16 @@ impl Response {
             .map(|info| info.remote_addr())
     }
 
+    /// Returns a reference to the associated extensions.
+    pub fn extensions(&self) -> &http::Extensions {
+        &self.extensions
+    }
+
+    /// Returns a mutable reference to the associated extensions.
+    pub fn extensions_mut(&mut self) -> &mut http::Extensions {
+        &mut self.extensions
+    }
+
     // body methods
 
     /// Get the full response text.
diff --git a/src/blocking/response.rs b/src/blocking/response.rs
index 96b0f8fe7..830c489a0 100644
--- a/src/blocking/response.rs
+++ b/src/blocking/response.rs
@@ -178,6 +178,16 @@ impl Response {
         self.inner.remote_addr()
     }
 
+    /// Returns a reference to the associated extensions.
+    pub fn extensions(&self) -> &http::Extensions {
+        self.inner.extensions()
+    }
+
+    /// Returns a mutable reference to the associated extensions.
+    pub fn extensions_mut(&mut self) -> &mut http::Extensions {
+        self.inner.extensions_mut()
+    }
+
     /// Get the content-length of the response, if it is known.
     ///
     /// Reasons it may not be known:


Test patch: