util: add LayerFn which implements Layer
for a closure
#267
Labels
A-layer
Area: The tower `Layer` trait
A-new-middleware
Area: new middleware proposals
A-util
Area: The tower "util" module
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-help-wanted
Call for participation: Help is requested to fix this issue.
I-needs-decision
Issues in need of decision.
T-middleware
Topic: middleware
Many layers are very simple, and it'd be useful to have a way to create one from a closure.
Example implementation
Need to decide on an exposed name:
tower::layer_fn()
tower::layer::from_fn()
(similar tostd::iter::from_fn
)tower::layer::mk()
(take from finagle, less clear)The text was updated successfully, but these errors were encountered: