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

serde-querystring-axum

A query string extractor for axum based on serde-querystring

3 unstable releases

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

#2174 in Encoding

Download history 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 37/week @ 2025-02-12 73/week @ 2025-02-19 57/week @ 2025-02-26 62/week @ 2025-03-05 91/week @ 2025-03-12 4/week @ 2025-03-19 68/week @ 2025-03-26 6/week @ 2025-04-02 14/week @ 2025-04-09 17/week @ 2025-04-16

76 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.3MB
~46K SLoC