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.
Motivation
Currently, many tower service wrappers and layers are limited to working with
'static
types, which limits its usefulness when working with non-static
ally 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
andBufferLayer
which are more difficult to make non-'static
.This PR replaces #732