summaryrefslogtreecommitdiff
path: root/examples/validator/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/validator/src/main.rs')
-rw-r--r--examples/validator/src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/validator/src/main.rs b/examples/validator/src/main.rs
index c8ce8c08..8682eb85 100644
--- a/examples/validator/src/main.rs
+++ b/examples/validator/src/main.rs
@@ -60,16 +60,17 @@ async fn handler(ValidatedForm(input): ValidatedForm<NameInput>) -> Html<String>
pub struct ValidatedForm<T>(pub T);
#[async_trait]
-impl<T, B> FromRequest<B> for ValidatedForm<T>
+impl<T, S, B> FromRequest<S, B> for ValidatedForm<T>
where
T: DeserializeOwned + Validate,
+ S: Send,
B: http_body::Body + Send,
B::Data: Send,
B::Error: Into<BoxError>,
{
type Rejection = ServerError;
- async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
+ async fn from_request(req: &mut RequestParts<S, B>) -> Result<Self, Self::Rejection> {
let Form(value) = Form::<T>::from_request(req).await?;
value.validate()?;
Ok(ValidatedForm(value))