#serde #url #serialization #url-parameters

serde_url_params

URL parameters serialization

4 releases

0.2.1 Jan 16, 2021
0.2.0 Jan 9, 2020
0.1.1 Sep 25, 2018
0.1.0 Aug 24, 2017

#524 in Encoding

Download history 5242/week @ 2025-06-02 6601/week @ 2025-06-09 7870/week @ 2025-06-16 7884/week @ 2025-06-23 5702/week @ 2025-06-30 4961/week @ 2025-07-07 7137/week @ 2025-07-14 4198/week @ 2025-07-21 5406/week @ 2025-07-28 4543/week @ 2025-08-04 4852/week @ 2025-08-11 5305/week @ 2025-08-18 5812/week @ 2025-08-25 5676/week @ 2025-09-01 6478/week @ 2025-09-08 6955/week @ 2025-09-15

25,236 downloads per month
Used in 25 crates (19 directly)

MIT/Apache

33KB
892 lines

Serde URL Params

crates-badge docs-badge license-badge ci-badge

Serialization of URL parameters from Rust structs.

Example

#[derive(Debug, Serialize)]
enum Filter { New, Registered, Blocked }

#[derive(Debug, Serialize)]
struct Params {
    cursor: Option<usize>,
    per_page: Option<usize>,
    username: String,
    filter: Vec<Filter>,
}

let params = Params {
    cursor: Some(42),
    per_page: None,
    username: String::from("boxdot"),
    filter: vec![Filter::New, Filter::Blocked],
};
assert_eq!(
    serde_url_params::to_string(&params).unwrap(),
    "cursor=42&username=boxdot&filter=New&filter=Blocked"
);

License

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this document by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.3–3.5MB
~58K SLoC