Registry / serialization / serde-url-params

serde-url-params

JSON →
library0.2.1rscratesunverified

Serializes and deserializes Rust structs to/from URL query string parameters using Serde.

# Cargo.toml [dependencies] serde_url_params = "0.2.1"
INSTALL
IMPORT
SIG · SERDE-URL-PARAMS
S
serde-url-params
serializationrustv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

to_string
use serde_url_params::to_string;

Serializes a struct to a URL query string and deserializes it back.

use serde::{Serialize, Deserialize}; use serde_url_params::{to_string, from_str}; #[derive(Serialize, Deserialize)] struct Params { name: String, age: u32, } fn main() -> Result<(), Box<dyn std::error::Error>> { let params = Params { name: "Alice".into(), age: 30 }; let query = to_string(¶ms)?; println!("Query string: {}", query); let decoded: Params = from_str(&query)?; println!("Decoded: {} {}", decoded.name, decoded.age); Ok(()) }
Debug
Known issues
gotchaDoes not handle nested structures or complex types; only flat structs with primitive fields are supported.
fix
Flatten nested structs or use a different serialization approach for complex data.
affects: *
Upgrade
Version history
0.2.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
serde-url-params — cargo add serde-url-params · libregistry