mirror of
https://github.com/tokio-rs/axum.git
synced 2025-10-02 07:20:38 +00:00
Updated docs regarding constraints of Handler arguments (#2451)
This commit is contained in:
parent
4f010d9b2d
commit
6c276c3ff0
@ -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:
|
axum provides blanket implementations for functions that:
|
||||||
|
|
||||||
- Are `async fn`s.
|
- 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`].
|
- Returns something that implements [`IntoResponse`].
|
||||||
- If a closure is used it must implement `Clone + Send` and be
|
- If a closure is used it must implement `Clone + Send` and be
|
||||||
`'static`.
|
`'static`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user