mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 07:20:12 +01:00
Updated docs regarding constraints of Handler arguments (#2451)
This commit is contained in:
parent
4f010d9b2d
commit
6c276c3ff0
1 changed files with 3 additions and 1 deletions
|
@ -4,7 +4,9 @@ For a function to be used as a handler it must implement the [`Handler`] trait.
|
|||
axum provides blanket implementations for functions that:
|
||||
|
||||
- Are `async fn`s.
|
||||
- Take no more than 16 arguments that all implement [`FromRequest`].
|
||||
- Take no more than 16 arguments that all implement `Send`.
|
||||
- All except the last argument implement [`FromRequestParts`].
|
||||
- The last argument implements [`FromRequest`].
|
||||
- Returns something that implements [`IntoResponse`].
|
||||
- If a closure is used it must implement `Clone + Send` and be
|
||||
`'static`.
|
||||
|
|
Loading…
Reference in a new issue