mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-17 00:00:16 +02:00
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
22 lines
334 B
Rust
22 lines
334 B
Rust
use axum::{
|
|
extract::{FromRequest, Json},
|
|
response::Response,
|
|
};
|
|
use serde::Deserialize;
|
|
|
|
#[derive(Deserialize, FromRequest)]
|
|
#[from_request(via(Json))]
|
|
struct Extractor {
|
|
one: i32,
|
|
two: String,
|
|
three: bool,
|
|
}
|
|
|
|
fn assert_from_request()
|
|
where
|
|
Extractor: FromRequest<(), Rejection = Response>,
|
|
{
|
|
}
|
|
|
|
fn main() {}
|