let the reference of HttpRequest in the ServiceRequest could be access

This commit is contained in:
Bob 2019-06-04 11:17:52 +08:00
parent 0e138e111f
commit 400062fe7b
1 changed files with 6 additions and 0 deletions

View File

@ -80,6 +80,12 @@ impl ServiceRequest {
ServiceResponse::new(self.0, res.into_body()) ServiceResponse::new(self.0, res.into_body())
} }
/// This method returns reference to the request
#[inline]
pub fn request(&self) -> &HttpRequest {
&self.0
}
/// This method returns reference to the request head /// This method returns reference to the request head
#[inline] #[inline]
pub fn head(&self) -> &RequestHead { pub fn head(&self) -> &RequestHead {