Crates.io | serde-querystring-actix |
lib.rs | serde-querystring-actix |
version | 0.3.0-beta.0 |
source | src |
created_at | 2020-11-22 17:39:57.304357 |
updated_at | 2024-08-08 14:30:44.352487 |
description | A query string extractor for actix-web based on serde-querystring |
homepage | |
repository | https://github.com/pooyamb/serde-querystring/ |
max_upload_size | |
id | 315076 |
size | 11,578 |
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)
}