axum-body-split

Crates.ioaxum-body-split
lib.rsaxum-body-split
version0.1.0
created_at2025-03-13 18:14:33.454441+00
updated_at2025-03-13 18:14:33.454441+00
descriptionA library to use multiple FromRequest extractors in axum
homepage
repositoryhttps://github.com/lukas0008/axum-body-split
max_upload_size
id1591278
size20,216
(lukas0008)

documentation

README

Axum Body Split

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

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>

Examples

check out examples for examples of how to use this

Commit count: 1

cargo fmt