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
Linux LAPTOP-0F8O2SNI 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Description
I have a State<_> extractor and a Json<_> extractor, and it cause an error when I place State<_> after Json<_>, it works well when these two are reversed.
App is my custom state, and Vo is an input parameter from request, which has implemented Deserialize
in the wrong code snippt, it has the following error message when add the function to router:
error[E0277]: the trait bound `fn(axum::Json<vo::pdf_convert::PdfConvertVo>, axum::extract::State<ryplat::app::App>) -> impl futures_util::Future<Output = ryplat::api::common::ResultDTO<std::string::String>> {service::file_convert::pdf_convert::pdf_to_image}: axum::handler::Handler<_, _, _>` is not satisfied
--> src/main.rs:18:48
|
18 | .route("/a/convert/pdf/to/image", post(pdf_to_image))
| ---- ^^^^^^^^^^^^ the trait `axum::handler::Handler<_, _, _>` is not implemented for fn item `fn(axum::Json<vo::pdf_convert::PdfConvertVo>, axum::extract::State<ryplat::app::App>) -> impl futures_util::Future<Output = ryplat::api::common::ResultDTO<std::string::String>> {service::file_convert::pdf_convert::pdf_to_image}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `axum::handler::Handler<T, S, B>`:
<axum::handler::Layered<L, H, T, S, B, B2> as axum::handler::Handler<T, S, B2>>
<axum::routing::MethodRouter<S, B> as axum::handler::Handler<(), S, B>>
note: required by a bound in `axum::routing::post`
--> /home/dpr/.cargo/registry/src/crates.obei.com.cn-8e030f22a0aa026e/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)
The text was updated successfully, but these errors were encountered:
Bug Report
Version
├── axum v0.6.20
│ ├── axum-core v0.3.4
│ ├── axum v0.6.20 ()
│ │ │ ├── axum v0.6.20 ()
Platform
Linux LAPTOP-0F8O2SNI 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Description
I have a
State<_>
extractor and aJson<_>
extractor, and it cause an error when I placeState<_>
afterJson<_>
, it works well when these two are reversed.I tried this code:
this works:
and this not:
App
is my custom state, andVo
is an input parameter from request, which has implementedDeserialize
in the wrong code snippt, it has the following error message when add the function to router:
The text was updated successfully, but these errors were encountered: