Is there any way to use Extension or State in non-handler functions without passing to them? #2764
Answered
by
mladedav
hlf20010508
asked this question in
Q&A
-
SummaryIs there a function like axum version0.7.5 |
Beta Was this translation helpful? Give feedback.
Answered by
mladedav
Jun 4, 2024
Replies: 1 comment
-
Not really since the function would have to return different things for different requests and in the case of state different things for different handlers. So you need a raw |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hlf20010508
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not really since the function would have to return different things for different requests and in the case of state different things for different handlers.
So you need a raw
Request
(or rather its extensions) and you could pass around that if you're using a lot of them.