func: impl Fn(Request, RouteContext<D>) -> T + 'static
which is an argument-position impl trait type (APIT), since I don't see any reason for requiring the passed-in callback is a function pointer, since we're immediately boxing it up and erasing the type.
Specifically, this ensures that you can pass a (currently nightly-only) async closure (async ||), which currently does not support being coerced to a fn ptr type. I'd like to avoid needing to implement that functionality that if possible.
This PR relaxes the type of the callback
into
which is an argument-position impl trait type (APIT), since I don't see any reason for requiring the passed-in callback is a function pointer, since we're immediately boxing it up and erasing the type.
Specifically, this ensures that you can pass a (currently nightly-only) async closure (
async ||
), which currently does not support being coerced to a fn ptr type. I'd like to avoid needing to implement that functionality that if possible.