From e575d35da2dde16ee487e2e6904c43e0b0d43661 Mon Sep 17 00:00:00 2001 From: Matt Fellenz Date: Fri, 15 Apr 2022 08:26:12 -0700 Subject: [PATCH] Improve documentation for FromRequest::Future --- actix-web/src/extract.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actix-web/src/extract.rs b/actix-web/src/extract.rs index 1b2f0bd19..684afb0aa 100644 --- a/actix-web/src/extract.rs +++ b/actix-web/src/extract.rs @@ -67,6 +67,10 @@ pub trait FromRequest: Sized { type Error: Into; /// Future that resolves to a Self. + /// + /// To refer to the type of an async function or block here, you have two options. + /// The first is to use a boxed future such as `futures::future::BoxFuture`. This works on stable and nightly. + /// The second is to use `impl Future`, which requires `#![feature(type_alias_impl_trait)]` so only works on nightly. type Future: Future>; /// Create a Self from request parts asynchronously.