serde-querystring-actix

Crates.ioserde-querystring-actix
lib.rsserde-querystring-actix
version0.3.0-beta.0
sourcesrc
created_at2020-11-22 17:39:57.304357
updated_at2024-08-08 14:30:44.352487
descriptionA query string extractor for actix-web based on serde-querystring
homepage
repositoryhttps://github.com/pooyamb/serde-querystring/
max_upload_size
id315076
size11,578
Pouya Mobasher Behrouz (pooyamb)

documentation

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

README

serde-querystring for actix-web

This crate provides an extractor for serde-querystring which can be used in place of the actix-web::Query extractor.

use serde::Deserialize;
use serde_querystring_actix::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