Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boxdot/serde-url-params-rs
URL parameters serialization
https://github.com/boxdot/serde-url-params-rs
rust serde url-parameters
Last synced: 30 days ago
JSON representation
URL parameters serialization
- Host: GitHub
- URL: https://github.com/boxdot/serde-url-params-rs
- Owner: boxdot
- License: apache-2.0
- Created: 2017-07-17T18:26:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-17T18:31:24.000Z (about 2 years ago)
- Last Synced: 2024-10-10T06:34:52.084Z (about 1 month ago)
- Topics: rust, serde, url-parameters
- Language: Rust
- Size: 35.2 KB
- Stars: 7
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Serde URL Params
[![crates-badge]][crates-url]
[![docs-badge]][docs-url]
[![license-badge]][license]
[![ci-badge]][ci-url][crates-badge]: https://img.shields.io/crates/v/serde-url-params.svg
[crates-url]: https://crates.io/crates/serde-url-params
[docs-badge]: https://docs.rs/serde_url_params/badge.svg
[docs-url]: https://docs.rs/serde_url_params
[license-badge]: https://img.shields.io/crates/l/serde-url-params.svg
[license]: #license
[ci-badge]: https://github.com/boxdot/serde-url-params-rs/workflows/rust/badge.svg
[ci-url]: https://github.com/boxdot/serde-url-params-rs/actionsSerialization of URL parameters from Rust structs.
## Example
```rust
#[derive(Debug, Serialize)]
enum Filter { New, Registered, Blocked }#[derive(Debug, Serialize)]
struct Params {
cursor: Option,
per_page: Option,
username: String,
filter: Vec,
}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(¶ms).unwrap(),
"cursor=42&username=boxdot&filter=New&filter=Blocked"
);
```## License
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT License ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)### 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.