Replies: 1 comment
-
It's an interesting idea. I'd consider a PR to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Implementation of new
ReqDataMove<T>
(likeReqData<T>
, but notClone
): request_data_move.rsFor example, if I pass my data from middleware, and in my request handler I need an owned value. I think this is very much useful, because Unlike app data, request data is dropped when the request has finished processing (quote source). So I don't understand why would I need
Rc<T>
, and where else would I need to use my data, if I would have usedReqData<Rc<T>>
. Maybe give me examples?Also if you need to mutate it, it's also easier (because it's owned), and you can later re-insert it back into the extensions map, so you will always have exactly one copy of the data. And if you have forgotten to re-insert it, and you use it elsewhere (but where can it be?), you will get a compile time error (I guess).
Can make it look better and send a PR
Beta Was this translation helpful? Give feedback.
All reactions