You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 19, 2023. It is now read-only.
Having a 'static lifetime requirement on Handlers seriously cripples handlers. This means you cannot have any &Ts in Handlers that aren't static also. I encountered this problem today while trying to integrate ivanceras/rustorm today with rustful with this code snippet. This doesn't work because ApiHandler stores a &Database, which isn't 'static. I work around this issue by diving a bit lower and passing around the r2d2 connection pool instead, but that heavily bloats my code.
tl;dr: please make Handler not require 'static, it would make it a lot more flexible
Having a
'staticlifetime requirement onHandlers seriously cripples handlers. This means you cannot have any&Ts inHandlers that aren't static also. I encountered this problem today while trying to integrate ivanceras/rustorm today with rustful with this code snippet. This doesn't work becauseApiHandlerstores a&Database, which isn't'static. I work around this issue by diving a bit lower and passing around the r2d2 connection pool instead, but that heavily bloats my code.tl;dr: please make
Handlernot require'static, it would make it a lot more flexible