yaml-split

Crates.ioyaml-split
lib.rsyaml-split
version0.4.0
sourcesrc
created_at2020-11-15 14:51:30.069031
updated_at2022-09-22 16:36:46.8969
descriptionprovides an iterator over individual YAML documents in a YAML file or stream
homepagehttps://github.com/Nessex/yaml2json-rs/blob/master/crates/yaml-split
repositoryhttps://github.com/Nessex/yaml2json-rs
max_upload_size
id312586
size15,315
Nathan Essex (Nessex)

documentation

https://docs.rs/yaml-split/

README

yaml-split

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.

Usage

let file = File::open(f).unwrap();
let doc_iter = DocumentIterator::new(file);

for doc in doc_iter {
    println!("Doc:\n{}\n", doc);
}
Commit count: 91

cargo fmt