Response lifetimes #2531
-
I have a situation where I need to return borrowed data in a stream. Ideally Hyper would be able to give me a lifetime like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What sort of data do you need to borrow? Do you mean a slice of bytes? Could you store those bytes in a |
Beta Was this translation helpful? Give feedback.
What sort of data do you need to borrow? Do you mean a slice of bytes? Could you store those bytes in a
hyper::body::Bytes
, and then just make clones of for the body? It's a reference counted buffer, so it's cheap for you to do that. Otherwise, I'd need more info to be able to better suggest a solution.