File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,22 @@ use crate::{Error, Result};
1313///
1414/// This is the main building block of a Cot app. You shouldn't
1515/// usually need to implement this directly, as it is already
16- /// implemented for closures and functions that take a [`Request`]
17- /// and return a [`Result<Response>`].
16+ /// implemented for closures and functions that take some
17+ /// number of [extractors](crate::request::extractors) as parameters
18+ /// and return some type that [can be converted into a
19+ /// response](IntoResponse).
20+ ///
21+ /// # Details
22+ ///
23+ /// Cot provides an implementation of `RequestHandler` for functions
24+ /// and closures that:
25+ /// * are marked `async`
26+ /// * take at most 10 parameters, all of which implement [`FromRequestParts`],
27+ /// except for at most one that implements [`FromRequest`]
28+ /// * return a type that implements [`IntoResponse`]
29+ /// * is `Clone + Send + 'static` (important if it's a closure)
30+ /// * return a future that is `Send` (i.e., doesn't hold any non-Send references
31+ /// across await points)
1832#[ diagnostic:: on_unimplemented(
1933 message = "`{Self}` is not a valid request handler" ,
2034 label = "not a valid request handler" ,
You can’t perform that action at this time.
0 commit comments