Crate facet_yaml

Crate facet_yaml 

Source
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.
YamlError
Error type for YAML operations.

Enums§

YamlErrorKind
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.