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
Latitude
AI Agents · Monitoring
Open-source AI agent monitoring that catches what will break next before your users do.
mesh-llm
AI Agents · AI Development
Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.
OpenBB
Analytics · Databases · Invoicing Finance
The AI Workspace for Finance: Connect Data, Run AI Agents, Build Analytics
openfootmanager
Game Development
A free and open source football management simulation game built with Rust and Tauri, inspired by Football Manager.
OpenViking
AI Development · AI Memory · Databases
An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.
PostHog
Ab Testing Experimentation · Analytics · Developer Tools
The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.
QuestDB
Analytics · Databases
A high-performance, open-source time-series database built for financial market data, IoT telemetry, and real-time analytics, combining a zero-GC Java/C++ core with SIMD-accelerated SQL and a WAL-to-Parquet storage engine.
Spacedrive
Collaboration · File Storage
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.
squad
AI Agents · Collaboration · Developer Tools
A daemonless Rust CLI that lets multiple AI coding agents collaborate across terminals through a shared SQLite database instead of a server.