The Duper logo, with a confident spectacled mole wearing a flailing blue cape.

Axum Duper

crates.io version GitHub license

Duper extractor / response for `axum`. [Check out the official website for Duper.](https://duper.dev.br) ## Installation ```bash cargo add axum_duper ``` ## Example ```rust use axum::{Router, routing::post}; use axum_duper::Duper; use serde::{Deserialize, Serialize}; use uuid::Uuid; #[derive(Deserialize)] struct CreateUser { email: String, password: String, } #[derive(Serialize)] struct UserResponse { id: Uuid, } async fn create_user(Duper(payload): Duper) -> impl IntoResponse { let id = Uuid::new_v4(); add_user_to_db(payload).await; Duper(UserResponse { id }) } async fn add_user_to_db(user: CreateUser) { // ... } let app = Router::new().route("/users", post(create_user)); ```