Crates.io | yaml-split |
lib.rs | yaml-split |
version | 0.4.0 |
source | src |
created_at | 2020-11-15 14:51:30.069031 |
updated_at | 2022-09-22 16:36:46.8969 |
description | provides an iterator over individual YAML documents in a YAML file or stream |
homepage | https://github.com/Nessex/yaml2json-rs/blob/master/crates/yaml-split |
repository | https://github.com/Nessex/yaml2json-rs |
max_upload_size | |
id | 312586 |
size | 15,315 |
yaml-split is a library which provides an iterator over individual YAML documents in a file or stream.
For example, you might have a YAML file like the following:
hello: world
---
foo: bar
This file contains two separate YAML documents. yaml-split will provide you the following two values in-order:
hello: world
---
foo: bar
This output is suitable for use by existing YAML deserializers such as serde-yaml.
let file = File::open(f).unwrap();
let doc_iter = DocumentIterator::new(file);
for doc in doc_iter {
println!("Doc:\n{}\n", doc);
}