API Reference
serde_yaml
YAML serialization and deserialization for Rust built on serde and a libyaml-derived parser.
Official Documentation ↗CompatibilityThis documentation covers version
v0.9. Check the official docs for the latest API surface.Installation
cargo
cargo add serde_yamlMethods
No methods match this filter.
serde_yaml maps YAML documents to Rust structs and back through serde derives.
Key Features
- Struct mapping with serde derives
- Value type for untyped access
- Multi-document streams
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://docs.rs/serde_yaml/latest/serde_yaml/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:52:26.589Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Error An error that happened serializing or deserializing YAML data. (https://docs.rs/serde_yaml/latest/serde_yaml/)
- Type Aliases § Result Alias for a Result with the error type serde_yaml::Error . (https://docs.rs/serde_yaml/latest/serde_yaml/)
FAQ
- How do I read several documents?
- Use Deserializer::from_str and iterate over the documents, decoding each one into your type.
- How do I rename fields?
- Use serde attributes such as #[serde(rename = "name")] on the struct fields.
- Should I use serde_yaml in production?
- It is deprecated upstream; for new code prefer a maintained alternative, but it remains widely used in existing projects.
Report a problem with this API docOpens a pre-filled issue on GitHub.