Structurehummingbird 2.10.0Hummingbird
_Middleware2
A middleware that composes two other middlewares.
struct _Middleware2<M0, M1> where M0 : MiddlewareProtocol, M1 : MiddlewareProtocol, M0.Context == M1.Context, M0.Input == M1.Input, M0.Output == M1.Output
The two provided middlewares will be chained together, with M0
first executing, followed by M1
.
You won’t typically construct this middleware directly, but instead will use result builder syntax.
router.addMiddleware {
MiddlewareOne()
MiddlewareTwo()
}