Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: add layer fns to middleware #524

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Jan 12, 2021

This branch adds AndThen::layer, Then::layer, MapErr::layer,
MapRequest::layer, MapResponse::layer, and MapResult::layer
associated functions that simply return each middleware's associated
layer type. This can be more convenient in some cases, since it avoids
having to import both the layer type and the middleware type.

Similar functions already exist for other middleware, such as
BoxService.

This branch adds `AndThen::layer`, `Then::layer`, `MapErr::layer`,
`MapRequest::layer`, `MapResponse::layer`, and `MapResult::layer`
associated functions that simply return each middleware's associated
layer type. This can be more convenient in some cases, since it avoids
having to import both the layer type and the middleware type.

Similar functions already exist for other middleware, such as
`BoxService`.
@hawkw hawkw self-assigned this Jan 12, 2021
@hawkw hawkw requested a review from a team January 12, 2021 18:27
@hawkw hawkw merged commit aa29693 into master Jan 12, 2021
@hawkw hawkw deleted the eliza/convenience-layer-fns branch January 12, 2021 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants