serde-querystring-axum

Crates.ioserde-querystring-axum
lib.rsserde-querystring-axum
version0.3.0-beta.0
sourcesrc
created_at2023-02-01 05:53:33.987478
updated_at2024-08-08 14:22:18.550115
descriptionA query string extractor for axum based on serde-querystring
homepage
repositoryhttps://github.com/pooyamb/serde-querystring/
max_upload_size
id773286
size11,962
Pouya Mobasher Behrouz (pooyamb)

documentation

https://docs.rs/serde-querystring-axum

README

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)
}
Commit count: 135

cargo fmt