diff options
| author | batsumaru <> | 2026-10-16 15:17:17 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-10-16 15:17:17 +0900 |
| commit | b49bb08c7a77fe4b29cf4ed0504c2f1c32a025e3 (patch) | |
| tree | ea763ca8cb858768e8ac8179f0bd6e32978541b7 /src/extract.rs | |
| parent | ad9a134daec1f73940e8deaeb6c2a481ce9d6520 (diff) | |
Update error responses
Diffstat (limited to 'src/extract.rs')
| -rw-r--r-- | src/extract.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/extract.rs b/src/extract.rs new file mode 100644 index 0000000..d1adffb --- /dev/null +++ b/src/extract.rs @@ -0,0 +1,15 @@ +use axum::extract::{FromRequest, FromRequestParts}; + +use crate::error::AppError; + +#[derive(FromRequest)] +#[from_request(via(axum::Json), rejection(AppError))] +pub struct AppJson<T>(pub T); + +#[derive(FromRequestParts)] +#[from_request(via(axum::extract::Query), rejection(AppError))] +pub struct AppQuery<T>(pub T); + +#[derive(FromRequestParts)] +#[from_request(via(axum::extract::Path), rejection(AppError))] +pub struct AppPath<T>(pub T); |
