Feature Request: implement layer
method on ServiceExt
#766
Labels
A-layer
Area: The tower `Layer` trait
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
I-needs-decision
Issues in need of decision.
P-low
Low priority
T-middleware
Topic: middleware
I am currently working on a project where middleware is applied bottom-up, i.e. the middleware is appended after the services (which is also the case in axum for example, where middlewares are applied after the routes). I noticed that there is no way to add a layer to a service except calling
Layer::layer
or using theServiceBuilder
, both of which are top-down, i.e. the middlewares are added before the services. In my project, I'm currently using this helper trait:This allows you to apply middleware like this:
I see no reason to not include this in
tower::ServiceExt
, so I'm filing this issue as a feature request.The text was updated successfully, but these errors were encountered: