mirror of
https://github.com/actix/actix-web.git
synced 2024-11-25 19:11:10 +00:00
Add getters for &ServiceRequest
(#2786)
This commit is contained in:
parent
6b7196225e
commit
5d0e8138ee
2 changed files with 15 additions and 0 deletions
|
@ -2,7 +2,10 @@
|
|||
|
||||
## Unreleased - 2022-xx-xx
|
||||
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
|
||||
### Added
|
||||
- Add `ServiceRequest::{parts, request}()` getter methods. [#2786]
|
||||
|
||||
[#2786]: https://github.com/actix/actix-web/pull/2786
|
||||
|
||||
## 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 a new issue