mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-31 11:02:08 +01:00
Add getters for &ServiceRequest
(#2786)
This commit is contained in:
parent
6b7196225e
commit
5d0e8138ee
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
## Unreleased - 2022-xx-xx
|
## Unreleased - 2022-xx-xx
|
||||||
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
|
- 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
|
## 4.1.0 - 2022-06-11
|
||||||
### Added
|
### Added
|
||||||
|
@ -95,6 +95,18 @@ impl ServiceRequest {
|
|||||||
(&mut self.req, &mut self.payload)
|
(&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).
|
/// 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
|
/// Returns the `T` extractor's `Future` type which can be `await`ed. This is particularly handy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user