mirror of https://github.com/fafhrd91/actix-web
added parts and request methods, updated changelog
This commit is contained in:
parent
062127a210
commit
0428c01181
|
@ -1,7 +1,7 @@
|
|||
# Changelog
|
||||
|
||||
## Unreleased - 2021-xx-xx
|
||||
|
||||
- Add `ServiceRequest::{parts, request}()` to make it easier to use middlewares that only have access to a `&ServiceRequest`.
|
||||
|
||||
## 4.1.0 - 2022-06-11
|
||||
### Added
|
||||
|
|
|
@ -95,6 +95,18 @@ impl ServiceRequest {
|
|||
(&mut self.req, &mut self.payload)
|
||||
}
|
||||
|
||||
/// Returns immutable accessors to inner parts.
|
||||
#[inline]
|
||||
pub fn parts(&self) -> (&HttpRequest, &Payload) {
|
||||
(&self.req, &self.payload)
|
||||
}
|
||||
|
||||
/// Returns immutable accessor to inner [`HttpRequest`].
|
||||
#[inline]
|
||||
pub fn request(&self) -> &HttpRequest {
|
||||
&self.req
|
||||
}
|
||||
|
||||
/// Derives a type from this request using an [extractor](crate::FromRequest).
|
||||
///
|
||||
/// Returns the `T` extractor's `Future` type which can be `await`ed. This is particularly handy
|
||||
|
|
Loading…
Reference in New Issue