Skip to content

How can I find current Request info in my customized implementation of IntoResponse trait #573

Answered by davidpdrsn
gy0801151351 asked this question in Q&A
Discussion options

You must be logged in to vote

Well the state needs to get passed from the request to the response somehow. You can either do that when constructing the response your handler or transferring it in a middleware. The docs have examples of how to write middleware.

There is no way to “magically” move data from requests to responses.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidpdrsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #572 on November 27, 2021 17:53.