diff --git a/src/extractor.rs b/src/extractor.rs index 1fc6c0784..e88998c79 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -211,6 +211,13 @@ impl FromRequest for Query /// ``` pub struct Form(pub T); +impl Form { + /// Deconstruct to an inner value + pub fn into_inner(self) -> T { + self.0 + } +} + impl Deref for Form { type Target = T; diff --git a/src/json.rs b/src/json.rs index 977c8d183..646a01112 100644 --- a/src/json.rs +++ b/src/json.rs @@ -22,6 +22,13 @@ use httpresponse::HttpResponse; /// and second is for extracting typed information from request's payload. pub struct Json(pub T); +impl Json { + /// Deconstruct to an inner value + pub fn into_inner(self) -> T { + self.0 + } +} + impl Deref for Json { type Target = T;