Function finchers_http::query::query [] [src]

pub fn query<T>() -> Query<T> where
    T: FromQuery

Create an endpoint which parse the query string in the HTTP request to the value of T.

Example

#[derive(Debug, Deserialize)]
pub struct Param {
    query: String,
    count: Option<u32>,
    #[serde(deserialize_with = "from_csv", default)]
    tags: Vec<String>,
}

let endpoint = query()
    .map_ok(|param: Serde<Param>| format!("Received: {:?}", &*param))
    .unwrap_ok();