pavex
pavex copied to clipboard
feat: Add `#[derive(FromRequest)]` macro for ergonomic extraction
The macro design in this PR is viable, and it's the interface we want to go for.
The implementation, though, isn't: this hardcodes specific constructors for each part of the request we are working with, violating Pavex's attempt to make everything customizable.
To properly support our goal, we will have to introduce a new feature in the dependency injection framework: allow the user to register a fallible constructor and then get a Result<T, E> injected, rather than passing than handling that Result automatically via a match + error handler invocation.