serializable-yaml

Crates.ioserializable-yaml
lib.rsserializable-yaml
version0.6.1
sourcesrc
created_at2023-07-01 01:51:41.088108
updated_at2023-07-22 01:09:39.93076
descriptionSerializable equivalent of yaml-rust
homepagehttps://crates.io/crates/serializable-yaml
repositoryhttps://gitlab.com/eguiraud/serializable-yaml
max_upload_size
id905180
size42,242
Enrico Guiraud (eguiraud)

documentation

https://docs.rs/serializable-yaml

README

pipeline status crates.io

Serializable YAML

This library makes yaml-rust's YAML enum serializable.

Because of the orphan rule we cannot implement the necessary trait on the YAML enum directly, so instead this library provides its own serializable equivalent with the same name.

For (de)serialization of custom Rust types to/from YAML see serde_yaml.

Usage

// load some YAML with yaml-rust
let yaml = yaml_rust::YamlLoader::load_from_str(input).unwrap();
// convert it to the serializable-yaml equivalent
let yaml = serializable_yaml::from_vec(yaml);
// you can now serialize that YAML instance with serde_yaml
let yaml_as_string = serde_yaml::to_string(&yaml).unwrap();

Utility function from_map is also available, see the docs.

Known bugs and limitations

Only strings are supported as hashmap keys, no other types.

Please report any other bugs as GitLab issues.

Commit count: 21

cargo fmt