Compile error when using generic types in dependency injection #3036
Unanswered
HaoYang670
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It compiles after I replace |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hi, I meet some compile error when converting my server from concrete tyoe to generic type in dependency injection.
I have a trait defined for interacting with database
And I define the client in State as a shared dependency
And I have a handler defined
I have another function defined to get the router
but I get compile error:
I have taken a look at https://github.com/tokio-rs/axum/blob/main/examples/dependency-injection/src/main.rs , but didn't find what may be wrong
axum version
0.7.9
Beta Was this translation helpful? Give feedback.
All reactions