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

serde-querystring-axum

A query string extractor for axum based on serde-querystring

2 unstable releases

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

#1827 in Encoding

Download history 50/week @ 2024-07-14 41/week @ 2024-07-21 13/week @ 2024-07-28 142/week @ 2024-08-04 13/week @ 2024-08-11 35/week @ 2024-08-18 25/week @ 2024-08-25 55/week @ 2024-09-01 2/week @ 2024-09-08 34/week @ 2024-09-15 96/week @ 2024-09-22 78/week @ 2024-09-29 79/week @ 2024-10-06 86/week @ 2024-10-13 42/week @ 2024-10-20 92/week @ 2024-10-27

300 downloads per month

MIT/Apache

105KB
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.7–2.6MB
~51K SLoC