Struct cataclysm::http::Query [−][src]
pub struct Query<Q>(pub Q);
Expand description
Query extractor
Allows to use a structure that implements DeserializeOwned
to extract information easier from the query
use cataclysm::http::{Response, Query};
use serde::{Deserialize};
#[derive(Deserialize)]
struct QueryParams {
name: String,
last_name: Option<String>
}
async fn check_query(query: Query<QueryParams>) -> Response {
log::info!("Http call from {}", query.into_inner().name);
Response::ok()
}
Deserialization error will result always in a bad request response
Tuple Fields
0: Q
Implementations
Retrieves the inner instance of the generic type