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
204 downloads per month
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