cookie-rs
cookie-rs copied to clipboard
Why CookieJar uses 'static lifetime on cookies?
I just don't understand why.
As I assume, cookies lives only during request handling (from parsing http headers until finishing sending http body). Why CookieJar uses 'static
attribute on definitely non-static data?
The other questions: Does it leak memory by making non-static data static? How it is making cookie data static?
The method that I am talking about is here.
If I understood correctly, the all data getters of Cookie<'static>
returns references with lifetime bound to reference to &Cookie
itself but not to lifetime generic parameter of the struct definition.
#137 - I don't think any particular reason. In this PR @SergioBenitez says he's fine with lifetime changes
Thank you!