-
How can I use Axums extract::State inside a socket handler as it only takes one argument ( |
Beta Was this translation helpful? Give feedback.
Answered by
Totodore
Aug 13, 2023
Replies: 1 comment
-
You can't use axum state extractor with your handler because socketioxide is not an axum handler it is a middleware in front of axum (or anything based on hyper. Currently the lib lacks of some state management. The only things you can use are Extensions with a cloned Or to clone an |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Totodore
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can't use axum state extractor with your handler because socketioxide is not an axum handler it is a middleware in front of axum (or anything based on hyper. Currently the lib lacks of some state management.
The only things you can use are Extensions with a cloned
Arc
of your state for each socket.Or to clone an
Arc
of your state in each of your handler.