A beginner’s question about middleware: error[E0277]: the trait bound `axum::middleware::FromFn<fn(hyper::Request<axum::body::Body>, Next) -> impl Future<Output = #2766
Replies: 3 comments 1 reply
-
These kinds of problems usually happen when the future generated by the function stops being |
Beta Was this translation helpful? Give feedback.
-
I successfully dealt with this issue,https://stackoverflow.com/questions/76307624/unexplained-trait-bound-no-longer-satisfied-when-modifying-axum-handler-body |
Beta Was this translation helpful? Give feedback.
-
Bug Report
Version
axum = "0.7.5"
hyper = "1.3.1"
tokio = { version = "1.37.0", features = ["full"] }
Description
In the above code,
let res = common::cache::member_rds::get_user_by_token(ut).await;
will cause a problem, causing the compilation to fail. Comment it out and the compilation will be successful, but it will not achieve the function I want. , can anyone explain the reason? I'm really confused as to why:
According to my idea, calling another async in async should be completely unrelated, but it was beyond my expectation.
redis
fred = "9.0.1"
is used inget_user_by_token
Beta Was this translation helpful? Give feedback.
All reactions