nested_qs

Crates.ionested_qs
lib.rsnested_qs
version0.1.2
sourcesrc
created_at2017-11-09 20:42:54.084197
updated_at2020-07-06 22:09:16.641601
descriptionSerializing/deserializing nested style querystrings with serde
homepage
repositoryhttps://github.com/kardeiz/nested_qs
max_upload_size
id38774
size24,888
Jacob Brown (kardeiz)

documentation

https://docs.rs/nested_qs

README

Nested querystrings with serde

Deserializes x-www-form-urlencoded strings/bytes into deserializable structs and vice versa.

Similar to and inspired by serde_qs.

Defers pretty much everything except key parsing to url::form_urlencoded and serde_json.

serde_json::Value is used as an intermediate object between the string and your struct. However, this is not as expensive as might be expected (you'll probably need to allocate a few strings anyway if you have any pluses or encoded chars in your querystring). Some casual benchmarking indicates it performs well in comparison to serde_qs.

Using serde_json::Value like this does not mean that JSON is used in the process. No JSON strings are involved at any point.

Use like:

let decoded: MyStruct = nested_qs::from_str(&encoded)?;
let encoded = nested_qs::to_string(&decoded)?;
Commit count: 8

cargo fmt