mirror of
https://github.com/tokio-rs/axum.git
synced 2025-10-01 06:51:05 +00:00

* Support `#[from_request(via(...))]` on enums * Check `#[from_request]` on variants * check for non enum/struct and clean up * changelog * changelog * remove needless feature * changelog ref
13 lines
262 B
Rust
13 lines
262 B
Rust
use axum::{body::Body, routing::get, Extension, Router};
|
|
use axum_macros::FromRequest;
|
|
|
|
#[derive(FromRequest, Clone)]
|
|
#[from_request(via(Extension))]
|
|
enum Extractor {}
|
|
|
|
async fn foo(_: Extractor) {}
|
|
|
|
fn main() {
|
|
Router::<Body>::new().route("/", get(foo));
|
|
}
|