mirror of https://github.com/fafhrd91/actix-web
Improve documentation for FromRequest::Future
This commit is contained in:
parent
de9e41484a
commit
e575d35da2
|
@ -67,6 +67,10 @@ pub trait FromRequest: Sized {
|
||||||
type Error: Into<Error>;
|
type Error: Into<Error>;
|
||||||
|
|
||||||
/// Future that resolves to a Self.
|
/// 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<Output = Result<Self, Self::Error>>;
|
type Future: Future<Output = Result<Self, Self::Error>>;
|
||||||
|
|
||||||
/// Create a Self from request parts asynchronously.
|
/// Create a Self from request parts asynchronously.
|
||||||
|
|
Loading…
Reference in New Issue