#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

#1876 in Encoding

Download history 17/week @ 2024-09-11 56/week @ 2024-09-18 106/week @ 2024-09-25 57/week @ 2024-10-02 108/week @ 2024-10-09 59/week @ 2024-10-16 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

184 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
~51K SLoC