Request and response in a server. fn handle_request<'req, 'resp>(&'req r: Request) -> Response<'req, 'resp>; Where the response might contain parts of the request, and also has references to the servers internal storage.
The only possible value that 'resp can hold there is 'static or 'req. Since 'static is a subtype of 'req, it's completely redundant.
-
-
'req does not need to be 'static, though I can see why for many it might be. Arena like shared storage for desrialized requests comes to mind.
-
It's a caller defined lifetime with no associated argument. The *only* lifetime you can synthesize like that is 'static unless you're using unsafe code.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.