serde_yaml
Strongly typed YAML serialization and deserialization for Rust, built on Serde
Repository Health
Technical Analysis
serde_yaml plugs the YAML 1.1 data format into the Serde serialization framework, so any Rust type that derives Serialize/Deserialize can be converted to and from YAML documents with the same type safety Serde provides for JSON, TOML, and other formats. It supports structs, enums (including YAML’s !Tag variant syntax), maps, sequences, and Serde’s full derive-macro ecosystem, backed internally by unsafe-libyaml, a Rust port of libyaml.
The crate is authored by David Tolnay, maintainer of Serde itself, and has been a long-standing default choice for YAML handling in the Rust ecosystem — used for parsing configuration files, Kubernetes-style manifests, and CI definitions. As of the final 0.9.34 release the crate is explicitly marked deprecated/no-longer-maintained by its author, though the existing API remains usable and widely depended upon.
What You Get
serde_yaml::to_string/from_strfor round-tripping any Serde-derived type through YAML- A
Valueenum for working with untyped/dynamic YAML documents when a concrete type isn’t known upfront - Support for YAML’s
!Tagenum-variant syntax mapping onto Rust enum variants - A
withmodule of helper (de)serializers for common non-default YAML representations - Integration with Serde’s full ecosystem of derive attributes (renames, defaults, flattening, etc.)
Common Use Cases
- Loading application configuration files written in YAML into strongly typed Rust config structs
- Parsing and generating Kubernetes-style or CI-pipeline YAML manifests programmatically
- Converting between YAML and other Serde-supported formats (JSON, TOML) via a shared intermediate type
- Working with untyped YAML documents via
serde_yaml::Valuewhen the schema isn’t known ahead of time
Under The Hood
Architecture - The crate implements Serde’s Serializer (src/ser.rs) and Deserializer (src/de.rs, ~1,850 lines) traits on top of an internal loader.rs that walks events produced by the bundled libyaml port, translating YAML’s node model (scalars, sequences, mappings, tagged variants) into Serde’s visitor callbacks; a separate value/ module provides an untyped Value enum and a mapping.rs ordered-map type for cases where the target schema isn’t known statically. Tech Stack - Pure Rust (edition 2021, MSRV 1.64), depending on unsafe-libyaml (a hand-ported, dependency-free Rust translation of the C libyaml parser) rather than an FFI binding, plus indexmap, itoa, and ryu for ordered maps and fast number formatting; it has no dependency on Serde beyond the core crate. Code Quality - tests/ covers deserialization (test_de.rs), serialization round-trips, error paths (test_error.rs), and the Value type separately, and the crate ships a fuzz/ target for the parser; the author (Serde’s maintainer) is known for rigorous API design, though the crate carries the +deprecated version suffix and the README states it is no longer maintained, so no further bug fixes should be expected upstream. API Design - The public API mirrors serde_json’s (to_string/from_str/Value) closely, which makes it near-zero-friction for anyone already familiar with Serde-based JSON handling, and the with module supplies ready-made (de)serializers for YAML-specific quirks like optional-vs-null distinctions.
Used by 25 apps in this directory
Svix
Automation · Developer Tools
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.
tabularis
Databases · Developer Tools
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.
Temps
Analytics · Devops · Monitoring
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.
Terrateam
Developer Tools · Devops
GitOps automation for Terraform, Pulumi, and IaC at scale
Tolaria
Note Taking
A free, open-source, local-first desktop app for managing markdown knowledge bases on macOS, Windows, and Linux — for second brains, company docs, or AI assistant memory and procedures.
Volga
Data Engineering
A Rust-based real-time data processing engine for AI/ML feature computation, built on Apache DataFusion and Arrow — positioned as an alternative to Flink, Spark, Chronon, and OpenMLDB with unified streaming, batch, and request-time execution.
Zed
Code Editors · Collaboration · Developer Tools
High-performance, multiplayer code editor built in Rust by the creators of Atom and Tree-sitter, with native AI integration and real-time collaboration.