#query-string #axum #deserialize #serde #serialization #derive-deserialize

serde-querystring-axum

A query string extractor for axum based on serde-querystring

3 unstable releases

new 0.3.0 Feb 9, 2025
0.3.0-beta.0 Aug 8, 2024
0.2.0 Feb 1, 2023

#1925 in Encoding

Download history 44/week @ 2024-10-23 159/week @ 2024-10-30 177/week @ 2024-11-06 46/week @ 2024-11-13 28/week @ 2024-11-20 39/week @ 2024-11-27 28/week @ 2024-12-04 124/week @ 2024-12-11 3/week @ 2024-12-18 10/week @ 2025-01-08 37/week @ 2025-01-15 31/week @ 2025-01-22 15/week @ 2025-01-29 121/week @ 2025-02-05

204 downloads per month

MIT/Apache

98KB
2.5K SLoC

serde-querystring for axum

This crate provides an extractor for serde-querystring which can be used in place of the axum::extract::Query extractor.

use serde::Deserialize;
use serde_querystring_axum::QueryString;

#[derive(Deserialize)]
pub struct AuthRequest {
   id: u64,
   scopes: Vec<u64>,
}

// In your handler
async fn index(QueryString(info): QueryString<AuthRequest>) -> String {
    format!("Authorization request for client with id={} and type={:?}!", info.id, info.scopes)
}

Dependencies

~1.5–2.4MB
~48K SLoC