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.
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.
-
-
I see. You took my pseudo code as legit code. ;) Yes, 'resp would need to be tied to some local storage. Cache’s in front of a DB would fit this model. So: fn handle<'req, 'resp>(cache: &'resp Cache, request: &'req) -> Response<'req, 'resp>; Tweet coding on phone == hard...
-
That cache could be TLS, or something else where it becomes == 'static, but that would possibly be more restrictive than necessary.
End of conversation
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.