#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

#1866 in Encoding

Download history 39/week @ 2024-08-23 39/week @ 2024-08-30 22/week @ 2024-09-06 28/week @ 2024-09-13 96/week @ 2024-09-20 78/week @ 2024-09-27 56/week @ 2024-10-04 108/week @ 2024-10-11 48/week @ 2024-10-18 78/week @ 2024-10-25 252/week @ 2024-11-01 73/week @ 2024-11-08 29/week @ 2024-11-15 16/week @ 2024-11-22 48/week @ 2024-11-29 106/week @ 2024-12-06

217 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.6–2.6MB
~50K SLoC