mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
add helper method for returning inner value
This commit is contained in:
parent
2ca0ea70c4
commit
94c5bb5cdd
@ -211,6 +211,13 @@ impl<T, S> FromRequest<S> for Query<T>
|
||||
/// ```
|
||||
pub struct Form<T>(pub T);
|
||||
|
||||
impl<T> Form<T> {
|
||||
/// Deconstruct to an inner value
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for Form<T> {
|
||||
type Target = T;
|
||||
|
||||
|
@ -22,6 +22,13 @@ use httpresponse::HttpResponse;
|
||||
/// and second is for extracting typed information from request's payload.
|
||||
pub struct Json<T>(pub T);
|
||||
|
||||
impl<T> Json<T> {
|
||||
/// Deconstruct to an inner value
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for Json<T> {
|
||||
type Target = T;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user