Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.
This repository was archived by the owner on May 19, 2023. It is now read-only.

Handler shouldn't have to be 'static #51

@andor44

Description

@andor44

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions