#yaml #deserialize #shapely #serialization #reflection #derive-debug

shapely-yaml

YAML serialization and deserialization for Shapely types

3 stable releases

Uses new Rust 2024

new 3.0.0 Mar 11, 2025
2.0.1 Mar 11, 2025

#1799 in Encoding

Download history

58 downloads per month

MIT/Apache

80KB
1.5K SLoC

shapely-yaml

experimental free of syn crates.io documentation MIT/Apache-2.0 licensed

[!IMPORTANT]

There is no stable shapely API as of now (even though it's >1.0.0). The design is very much still being explored.

Expect multiple major versions in the near future — (note left 2025-03-11)

YAML serialization and deserialization for Shapely types.

Example

use shapely::Shapely;
use shapely_yaml::from_yaml;

#[derive(Debug, Shapely, PartialEq)]
struct Config {
    name: String,
    version: u64,
}

let yaml = r#"
name: MyApp
version: 1
"#;

let mut partial = Config::partial();
from_yaml(&mut partial, yaml).expect("Failed to parse YAML");

let config = partial.build::<Config>();
assert_eq!(config, Config { name: "MyApp".to_string(), version: 1 });

License

Licensed under either of:

at your option.

Dependencies

~1MB
~18K SLoC