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
I used the example you gave, but got an error. Here is the error message:
error[E0277]: the trait bound fn(IncomingUpgrade) -> impl Future<Output = impl IntoResponse> {ws_handler}: Handler<_, _> is not satisfied
--> src/main.rs:8:44
|
8 | let app = Router::new().route("/", get(ws_handler));
| --- ^^^^^^^^^^ the trait Handler<_, _> is not implemented for fn item fn(IncomingUpgrade) -> impl Future<Output = impl IntoResponse> {ws_handler}
| |
| required by a bound introduced by this call
|
= note: Consider using #[axum::debug_handler] to improve the error message
= help: the following other types implement trait Handler<T, S>: Layered<L, H, T, S> implements Handler<T, S> MethodRouter<S> implements Handler<(), S>
note: required by a bound in axum::routing::get
--> C:\Users\Administrator.cargo\registry\src\index.crates.io-6f17d22bba15001f\axum-0.8.0-alpha.1\src\routing\method_routing.rs:386:1
|
386 | top_level_handler_fn!(get, GET);
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
| | |
| | required by a bound in this function
| required by this bound in get
= note: this error originates in the macro top_level_handler_fn (in Nightly builds, run with -Z macro-backtrace for more info)
The text was updated successfully, but these errors were encountered:
I used the example you gave, but got an error. Here is the error message:
error[E0277]: the trait bound
fn(IncomingUpgrade) -> impl Future<Output = impl IntoResponse> {ws_handler}: Handler<_, _>
is not satisfied--> src/main.rs:8:44
|
8 | let app = Router::new().route("/", get(ws_handler));
| --- ^^^^^^^^^^ the trait
Handler<_, _>
is not implemented for fn itemfn(IncomingUpgrade) -> impl Future<Output = impl IntoResponse> {ws_handler}
| |
| required by a bound introduced by this call
|
= note: Consider using
#[axum::debug_handler]
to improve the error message= help: the following other types implement trait
Handler<T, S>
:Layered<L, H, T, S>
implementsHandler<T, S>
MethodRouter<S>
implementsHandler<(), S>
note: required by a bound in
axum::routing::get
--> C:\Users\Administrator.cargo\registry\src\index.crates.io-6f17d22bba15001f\axum-0.8.0-alpha.1\src\routing\method_routing.rs:386:1
|
386 | top_level_handler_fn!(get, GET);
| ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
| | |
| | required by a bound in this function
| required by this bound in
get
= note: this error originates in the macro
top_level_handler_fn
(in Nightly builds, run with -Z macro-backtrace for more info)The text was updated successfully, but these errors were encountered: