New thought. Could we define the extractor trait with an input type like:
trait Extractor<Input> {
type Output;
fn extract(&self, args: Input) -> Self::Output;
}
Then say tide defines all it’s extractors as Extractor<Request, AppState, Config> and blanket impls for subsets of this (Extractor<Request, Config>, Extractor<Request, Config>, etc). Then extractor implementations could depend on what they actually need, and could be reused with any framework that provides those things?
It’s a shame there’s no way to treat type parameters as unordered…