25: Deserialize () from input without key/value pairs. r=nox Currently there's no input that can be deserialized to `()`, this changes the crate to support deserializing strings without any key/value pair to a `()` (such as the empty string, or just `"&"`). Would be great if you could release a patch for this, I have a project that needs this behavior. EDIT: To expand on my use case, I have a trait which parses the body of an HTTP Request into a type (e.g. for a `POST` request). However, this is abstract over HTTP methods, and its expected to be able to parse an empty body (e.g. from a `GET` request) into `()`.
x-www-form-urlencoded
meets Serde
This crate is a Rust library for serialising to and deserialising from
the application/x-www-form-urlencoded
format. It is built
upon Serde, a high performance generic serialization framework and rust-url,
a URL parser for Rust.
Installation
This crate works with Cargo and can be found on
crates.io with a Cargo.toml
like:
[dependencies]
serde_urlencoded = "0.5.1"
Getting help
Serde developers live in the #serde channel on
irc.mozilla.org
and most rust-url developers
live in the #servo one. The #rust channel is also a good resource with generally
faster response time but less specific knowledge about Serde, rust-url or this
crate. If IRC is not your thing, we are happy to respond to GitHub
issues as well.
License
serde_urlencoded is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in serde_urlencoded by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.