i have some code that's like this
struct F {
x: String,
}
async fn form_and_multipart(
Form(f): Form<F>,
m: Multipart,
) -> impl IntoResponse {
Html("")
}
but this doesn't work
error[E0277]: the trait bound `fn(Form<F>, Multipart) -> impl std::future::Future<Output = impl IntoResponse> {form_and_multipart}: Handler<_, _>` is not satisfied
--> src/act.rs:319:49
|
319 | ...).route("/", post(form_and_multipart));
| ---- ^^^^^^^^^^^^^^^^^^ the trait `Handler<_, _>` is not implemented for fn item `fn(Form<...>, ...) -> ... {form_and_multipart}`
| |
| required by a bound introduced by this call
|
= note: the full name for the type has been written to '/home/skye/src/pulver/target/debug/deps/pulver-80ef0135f62c1e85.long-type-5275344219598188898.txt'
= note: consider using `--verbose` to print the full type name to the console
= 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 `post`
--> /home/skye/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.7.5/src/routing/method_routing.rs:389:1
|
389 | 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)
For more information about this error, try `rustc --explain E0277`.
warning: `pulver` (lib test) generated 3 warnings (1 duplicate)
error: could not compile `pulver` (lib test) due to 1 previous error; 3 warnings emitted
and i don't know why. is what im trying to do not possible?