Open
Description
It would be nice to not have Request
have a generic parameter, for e.g. the AsyncRead
trait which requires pinning. See #642 (comment) for where this was originally encountered.
However in interest of keeping middleware simple it would still be nice to allow (Request, Next) -> Fut<Result<>>
, but for State
it would probably ideal to have an extra parameter, kinda like Surf's Client
, e.g. (Request, State, Next) -> Fut<Result<>>
.
I was thinking maybe server.middleware()
/ endpoints could take impl Into<Middleware<State>>
/ endpoint, and so then that trait could be applied to both of the above with an extra function wrapper for the simple case, allowing both to work, and scoping State
to the middleware/endpoint stack.
Metadata
Metadata
Assignees
Labels
No labels