feat: enable non-`'static` where possible
Motivation
Currently, many tower service wrappers and layers are limited to working with 'static types, which limits its usefulness when working with non-statically borrowed things to and from scoped tasks (e.g. async-scoped).
Solution
Remove the 'static restrictions where possible, mostly by introducing lifetime parameters.
This change excludes Buffer and BufferLayer which are more difficult to make non-'static. It is possible to do by abstracting tokio::spawn into a trait (which async_scoped::Scope can also implement), this is also pending the publish of the recently merged tokio-rs/tokio#5665.
@GlenDC Yes, it is mildly breaking, so probably has to wait for a minor version. Also I have lost access to the account which made this PR, so you can close it in favor of #765
Closing in favor in #765.