serde_urlencoded

Serialize and deserialize application/x-www-form-urlencoded data in Rust using Serde

Library
Cargo
v0.7.1
264 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
36 /100 Needs Attention
Development Activity 0
Maintenance 0
Community 64
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
73 /100 Good
Architecture 72
Code Quality 70
Innovation 68
Learning Curve 80

serde_urlencoded is a small, focused Rust crate that bridges the application/x-www-form-urlencoded wire format with Serde’s serialization framework. It lets any type implementing Serialize/Deserialize be converted to and from URL query-string or form-body encoding without hand-written parsing logic.

Built on top of form_urlencoded for percent-decoding and rust-url conventions, it is a common dependency behind HTTP client and server crates that need to encode query parameters or decode submitted form data, including reqwest and various web frameworks.

What You Get

  • to_string for serializing any Serde-compatible type into a URL-encoded string
  • from_str, from_bytes, and from_reader for deserializing URL-encoded data back into typed Rust values
  • Automatic percent-encoding/decoding via the form_urlencoded and rust-url crates
  • A no_unsafe_code guarantee (#![forbid(unsafe_code)]) for a small, auditable dependency surface
  • Standard Serde error types, making it composable with other Serde-based tooling

Common Use Cases

  • Encoding query parameters for outgoing HTTP requests in clients like reqwest
  • Decoding submitted HTML form bodies on the server side of a web framework
  • Round-tripping structured data through URL-safe string representations for links or redirects
  • Building typed configuration or filter objects from query-string parameters in REST APIs

Under The Hood

Architecture — The crate is split into two small modules, de (deserialization, src/de.rs) and ser (serialization, src/ser/ with mod.rs, pair.rs, part.rs, key.rs, value.rs). Deserialization wraps form_urlencoded::parse output in a Deserializer that hands pairs to Serde’s generic MapDeserializer, so any Deserialize impl — structs, HashMap, Vec<(String, String)> — works without crate-specific derive macros. Serialization mirrors this by walking a value’s Serde representation and emitting percent-encoded key=value pairs joined with &.

Tech Stack — Pure Rust, edition 2018, with a minimal dependency set: serde (>=1.0.69) for the data model, form_urlencoded and itoa/ryu (for fast integer/float-to-string formatting) for encoding primitives. No async runtime, no unsafe code (enforced via #![forbid(unsafe_code)]), and no build script — it’s a lightweight leaf dependency in the Rust web ecosystem.

Code Quality — The two test files tests/test_serialize.rs and tests/test_deserialize.rs cover round-trips for primitive types, nested structs, and collections. Source files are short (12-line lib.rs, ~325-line de.rs, ~555-line ser/mod.rs) and single-purpose. The crate has been effectively feature-complete since 2016, with only maintenance-level commits (98 total) since — activity is low but the surface area is small enough that this reflects stability rather than neglect.

API Design — The four entry points (to_string, from_str, from_bytes, from_reader) mirror the naming conventions used by serde_json and other Serde-format crates, so developers already familiar with Serde need zero ramp-up time. Doctested examples are embedded directly in the function docs, and the crate re-exports Serde’s standard Error type rather than inventing a new one, minimizing integration friction.

Used by 6 apps in this directory

Rust
99%
Other

Fluree DB

Databases

469

A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.

View details
87
Repo Health
74
Technical
65
Dependency
Built with
Rust 99%
Updated 5 days ago
Go
64%
MIT

hoop

Monitoring · Security

823

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
85
Repo Health
80
Technical
64
Dependency
Built with
Go 64%
Clojure 17%
JavaScript 11%
Updated 1 weeks ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
78%
AGPL 3.0

Lemmy

Community · Social Media

14,614

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

View details
89
Repo Health
74
Technical
62
Dependency
Built with
Rust 78%
PLpgSQL 14%
Updated 1 weeks ago
Rust
100%
Other

Meilisearch

Search

59,424

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust 100%
Updated 1 weeks ago
Rust
90%
Apache 2.0

Qdrant

AI Development · Databases · Search

34,857

Open-source vector database and search engine built in Rust for production-grade AI applications — from semantic search to RAG pipelines and recommendation systems.

View details
92
Repo Health
87
Technical
65
Dependency
Built with
Rust 90%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers