39 releases

1.0.0-rc.3 May 27, 2025
0.15.0 Apr 22, 2025
0.14.0 Mar 4, 2025
0.13.0 Apr 7, 2024
0.0.2 Mar 20, 2017

#54 in Encoding

Download history 524358/week @ 2025-05-29 472002/week @ 2025-06-05 605063/week @ 2025-06-12 540110/week @ 2025-06-19 603765/week @ 2025-06-26 600580/week @ 2025-07-03 681677/week @ 2025-07-10 834702/week @ 2025-07-17 814465/week @ 2025-07-24 717528/week @ 2025-07-31 758745/week @ 2025-08-07 675897/week @ 2025-08-14 597167/week @ 2025-08-21 563946/week @ 2025-08-28 636370/week @ 2025-09-04 491733/week @ 2025-09-11

2,413,155 downloads per month
Used in 1,909 crates (269 directly)

MIT/Apache

145KB
3K SLoC

Serde Querystrings badge-ci Latest Version Documentation

This crate is a Rust library for serialising to and deserialising from querystrings using serde. This crate is designed to extend serde_urlencoded when using nested parameters, similar to those used by qs for Node, and commonly used by Ruby on Rails via Rack.

The core of the library was inspired by serde_urlencoded. In order to support deserializing abitrarily nested structs encoded in arbitrary orders, we perform two passes over the input string. This adds a non-trivial amount of memory and compute, approximately a 50% overhead compared to serde_urlencoded. However, in absolute terms, deserialization is on the order of single-digit microseconds.

Similarly, serialization needs to buffer keys in case there are nested values, resulting in about 50% overhead.

For detailed benchmark documentation, see benches/README.md.

Installation

[!IMPORTANT] We are currently in the process of stabilizing a major v1 release of this crate. If you are evaluating this crate, consider using the release candidate over the stable 0.x release.

See this issue and the release notes for more information.

This crate works with Cargo and can be found on crates.io with a Cargo.toml like:

[dependencies]
serde_qs = "0.15"

Minimum supported Rust version is 1.68.

For older versions of Rust, serde_qs versions <= 0.11 support Rust 1.36.

License

serde_qs is licensed under either of

at your option.

Contribution

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

Dependencies

~0.3–16MB
~218K SLoC