expose http::Extensions in Response (#1476)
This commit is contained in:
@@ -122,6 +122,16 @@ impl Response {
|
|||||||
.map(|info| info.remote_addr())
|
.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
|
// body methods
|
||||||
|
|
||||||
/// Get the full response text.
|
/// Get the full response text.
|
||||||
|
|||||||
@@ -178,6 +178,16 @@ impl Response {
|
|||||||
self.inner.remote_addr()
|
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.
|
/// Get the content-length of the response, if it is known.
|
||||||
///
|
///
|
||||||
/// Reasons it may not be known:
|
/// Reasons it may not be known:
|
||||||
|
|||||||
Reference in New Issue
Block a user