Expand description
YAML serialization and deserialization for Facet types.
This crate provides YAML parsing using a streaming event-based parser (saphyr-parser) and integrates with the facet reflection system for type-safe deserialization.
§Example
use facet::Facet;
use facet_yaml::from_str;
#[derive(Facet, Debug, PartialEq)]
struct Config {
name: String,
port: u16,
}
let yaml = "name: myapp\nport: 8080";
let config: Config = from_str(yaml).unwrap();
assert_eq!(config.name, "myapp");
assert_eq!(config.port, 8080);Modules§
- serde
- Serde-compatible extension attributes for YAML serialization.
Structs§
- Span
- Source span with offset and length.
- Spanned
- A value with source span information.
- Yaml
- A wrapper type for YAML serialization and deserialization.
- Yaml
Error - Error type for YAML operations.
Enums§
- Yaml
Error Kind - Specific error kinds for YAML operations
Functions§
- from_
str - Deserialize a YAML string into a value of type
T. - from_
str_ borrowed - Deserialize YAML from a string slice, allowing zero-copy borrowing.
- to_
string - Serialize a value to a YAML string.
- to_
writer - Serialize a value to a writer as YAML.