| Crates.io | axum-body-split |
| lib.rs | axum-body-split |
| version | 0.1.0 |
| created_at | 2025-03-13 18:14:33.454441+00 |
| updated_at | 2025-03-13 18:14:33.454441+00 |
| description | A library to use multiple FromRequest extractors in axum |
| homepage | |
| repository | https://github.com/lukas0008/axum-body-split |
| max_upload_size | |
| id | 1591278 |
| size | 20,216 |
Tiny library to fix my annoyance with axum, where I sometimes just want a quick and dirty way to use an extractor implementing FromRequest twice.
Usage is like of any other extractor, but you need to add your state type as a type parameter (because FromRequest has access to the state, so it needs to know what type it is)
Example without state:
SplitBody(Json(json), text, _): SplitBody<Json<RequestJson>, String, ()>
Example with state:
SplitBody(Json(json), text, _): SplitBody<Json<RequestJson>, String, AppState>
check out examples for examples of how to use this