serde

A generic framework for serializing and deserializing Rust data structures efficiently and safely.

Library
Cargo
v1.0.229
10,838 stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
76 /100 Good
Development Activity 68
Maintenance 68
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
89 /100 Excellent
Architecture 94
Code Quality 92
Innovation 90
Learning Curve 78

Serde is the de facto standard serialization framework for Rust, splitting the problem into two halves: data structures that know how to serialize and deserialize themselves via the Serialize and Deserialize traits, and data formats that know how to turn structured data into bytes and back. The #[derive(Serialize, Deserialize)] macros generate trait implementations at compile time, so most projects never hand-write conversion code.

Because the trait layer is decoupled from any specific wire format, the same derived struct can be serialized to JSON, YAML, TOML, MessagePack, CBOR, Bincode, and dozens of other formats implemented by the surrounding Serde ecosystem, with zero-cost abstractions that let the compiler optimize away the indirection entirely.

What You Get

  • Serialize and Deserialize traits with a derive macro (#[derive(Serialize, Deserialize)]) for automatic, compile-time codegen on structs and enums
  • A data-model abstraction (29 self-describing types) that decouples your Rust types from any specific wire format
  • no_std and no_alloc support via feature flags, making it usable on embedded and constrained targets
  • Fine-grained field-level attributes (#[serde(rename = "...")], skip_serializing_if, default, flatten, with) for controlling exactly how fields map to the wire format
  • Compatibility with dozens of independently maintained format crates (serde_json, serde_yaml, bincode, rmp-serde, toml, and more) that all plug into the same trait layer

Common Use Cases

  • Parsing and emitting JSON payloads for HTTP APIs and web services
  • Loading and validating application configuration from TOML or YAML files
  • Encoding compact binary wire formats for RPC and network protocols
  • Persisting application state or cache entries to disk in a structured format
  • Converting between in-memory Rust types and external schemas (e.g. AWS Parameter Store, environment variables) via community format crates

Under The Hood

Architecture The workspace splits the public serde crate from serde_core, which holds the actual trait definitions and blanket implementations (~12,000 lines across ser/mod.rs, de/mod.rs, de/impls.rs, de/value.rs) so that serde_derive’s generated code and third-party format crates can depend on a stable core without pulling in the thin re-export layer. At runtime, a value’s Serialize::serialize call takes a format-supplied Serializer and drives it through calls like serialize_struct/serialize_map; deserialization mirrors this with a Deserializer handing data to a Visitor that builds the target type. serde_core/src/private/content.rs implements an intermediate buffered Content representation that powers advanced features such as #[serde(untagged)] enums and #[serde(flatten)], which need to peek at data before committing to a concrete deserialization path.

Tech Stack Pure Rust, edition 2021, with an MSRV of 1.56 for serde and 1.71 for serde_derive. The proc-macro derive layer depends on proc-macro2, quote, and syn 2.x (pinned at the workspace level), while the core trait crate has zero required dependencies, keeping it embeddable via no_std/no_alloc feature flags. The five-crate Cargo workspace (serde, serde_core, serde_derive, serde_derive_internals, test_suite) is built and tested through a single GitHub Actions workflow (.github/workflows/ci.yml).

Code Quality The test_suite crate contains 150 test files covering derive macro output, UI/compile-fail cases, byte handling, unstable features, and regression fixes, plus a dedicated no_std sub-crate that verifies the no-std build path compiles independently. Documentation density is unusually high for a systems library — serde_core’s ser/mod.rs and de/mod.rs alone contain over 2,700 lines of doc comments. Error handling is idiomatic throughout: Result<T, Self::Error> with an associated error type is threaded through every trait method rather than panicking, and naming stays consistent with Rust API guidelines (Serialize/Deserialize, Serializer/Deserializer, Visitor).

API Design The common case requires only serde = { version = "1", features = ["derive"] } plus a format crate and a #[derive(Serialize, Deserialize)] attribute — no boilerplate beyond that. The ~5% of cases needing custom behavior are handled through named, documented attributes (rename, default, skip_serializing_if, flatten, with) rather than requiring hand-written trait impls, and the consistent trait vocabulary is reused verbatim by every downstream format crate (serde_json, serde_yaml, bincode, etc.), so learning it once transfers across the entire ecosystem.

Used by 114 apps in this directory

Rust
74%
MIT

squad

AI Agents · Collaboration · Developer Tools

822

A daemonless Rust CLI that lets multiple AI coding agents collaborate across terminals through a shared SQLite database instead of a server.

View details
43
Repo Health
73
Technical
79
Dependency
Built with
Rust 74%
Shell 14%
HTML 12%
Updated 4 months ago
Rust
98%

Stalwart

Collaboration

14,848

All-in-one secure mail and collaboration server covering IMAP, JMAP, SMTP, CalDAV, CardDAV, and WebDAV in a single memory-safe Rust binary.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
Rust 98%
Updated 1 weeks ago
Java
46%
Other

Stirling PDF

Digital Signiture · Productivity

93,148

The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.

View details
92
Repo Health
86
Technical
71
Dependency
Built with
Java 46%
TypeScript 45%
Updated 1 weeks ago
Rust
47%
MIT

Svix

Automation · Developer Tools

3,423

Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.

View details
90
Repo Health
77
Technical
67
Dependency
Built with
Rust 47%
C# 15%
Updated 2 weeks ago
TypeScript
67%
Apache 2.0

tabularis

Databases · Developer Tools

5,076

Open-source desktop SQL workspace with built-in PostgreSQL, MySQL, and SQLite drivers, SQL notebooks, a visual query builder, and a built-in MCP server for AI agents like Claude and Cursor.

View details
83
Repo Health
89
Technical
70
Dependency
Built with
TypeScript 67%
Rust 32%
Updated 1 weeks ago
C
76%
AGPL 3.0

TDengine

Databases

25,146

A high-performance, open-source time-series database built in C for IoT, connected vehicles, and industrial monitoring workloads, with built-in stream processing, caching, and data subscription.

View details
97
Repo Health
71
Technical
68
Dependency
Built with
C 76%
C++ 16%
Updated 2 weeks ago
Rust
64%
Apache 2.0

Temps

Analytics · Devops · Monitoring

801

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
70
Dependency
Built with
Rust 64%
TypeScript 34%
Updated 1 weeks ago
Rust
79%
Apache 2.0

TensorZero

Ab Testing Experimentation · AI Development · Monitoring

11,717

TensorZero unifies the LLM gateway, observability, evaluation, optimization, and experimentation stack behind a single OpenAI-compatible API, built in Rust for sub-millisecond p99 latency.

View details
53
Repo Health
87
Technical
69
Dependency
Built with
Rust 79%
TypeScript 15%
Updated 4 months ago
OCaml
73%
MPL 2.0

Terrateam

Developer Tools · Devops

1,285

GitOps automation for Terraform, Pulumi, and IaC at scale

View details
86
Repo Health
72
Technical
74
Dependency
Built with
OCaml 73%
HCL 19%
Updated 1 weeks 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