You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I remove either _form or _addr from the arguments of handler, it compiles.
Otherwise I get the following error message :
error[E0277]: the trait bound `fn(axum::Form<pb_with_connect_info::LoginForm>, ConnectInfo<std::net::SocketAddr>) -> impl std::future::Future<Output = std::string::String> {handler}: axum::handler::Handler<_, _, _>` is not satisfied
--> src/pb_with_connect_info.rs:13:45
|
13 | let app = Router::new().route("/", post(handler));
| ---- ^^^^^^^ the trait `axum::handler::Handler<_, _, _>` is not implemented for fn item `fn(axum::Form<pb_with_connect_info::LoginForm>, ConnectInfo<std::net::SocketAddr>) -> impl std::future::Future<Output = std::string::String> {handler}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `axum::handler::Handler<T, S, B>`:
<axum_extra::handler::or::Or<L, R, Lt, Rt, S, B> as axum::handler::Handler<(M, Lt, Rt), S, B>>
<axum_extra::handler::IntoHandler<H, T, S, B> as axum::handler::Handler<T, S, B>>
<axum::handler::Layered<L, H, T, S, B, B2> as axum::handler::Handler<T, S, B2>>
<MethodRouter<S, B> as axum::handler::Handler<(), S, B>>
note: required by a bound in `axum::routing::post`
--> /home/thomas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.20/src/routing/method_routing.rs:407:1
|
407 | top_level_handler_fn!(post, POST);
| ^^^^^^^^^^^^^^^^^^^^^^----^^^^^^^
| | |
| | required by a bound in this function
| required by this bound in `post`
= note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
Thanks for your help!
The text was updated successfully, but these errors were encountered:
Bug Report
Version
axum v0.6.20
Platform
Linux archlinux 6.4.8-arch1-Yagakimi-T2-1-t2 #1 SMP PREEMPT_DYNAMIC Fri, 04 Aug 2023 14:49:02 +0000 x86_64 GNU/Linux
Description
I cannot compile with both
ConnectInfo
andForm
extractors, whereas they compile separately.If I remove either
_form
or_addr
from the arguments ofhandler
, it compiles.Otherwise I get the following error message :
Thanks for your help!
The text was updated successfully, but these errors were encountered: