#yaml

yaml-split

provides an iterator over individual YAML documents in a YAML file or stream

10 releases

0.4.0 Sep 22, 2022
0.3.2 Sep 7, 2021
0.3.1 Jul 25, 2021
0.2.8 Dec 20, 2020
0.2.7 Nov 17, 2020

#394 in Encoding

Download history 7/week @ 2022-11-28 41/week @ 2022-12-05 41/week @ 2022-12-12 25/week @ 2022-12-19 12/week @ 2022-12-26 30/week @ 2023-01-02 126/week @ 2023-01-09 102/week @ 2023-01-16 28/week @ 2023-01-23 38/week @ 2023-01-30 47/week @ 2023-02-06 76/week @ 2023-02-13 23/week @ 2023-02-20 19/week @ 2023-02-27 32/week @ 2023-03-06 81/week @ 2023-03-13

169 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

15KB
267 lines

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);
}

Dependencies

~0.7–1MB
~26K SLoC