mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-26 09:08:05 +01:00
4e4c29175f
Co-authored-by: Jonas Platte <jplatte+git@posteo.de> Co-authored-by: Michael Scofield <mscofield0@tutanota.com>
21 lines
334 B
Rust
21 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() {}
|