#yaml #iterator #file-stream #serde-yaml #individual #deserializer #world

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

#1286 in Encoding

Download history 40/week @ 2024-12-01 61/week @ 2024-12-08 16/week @ 2024-12-15 56/week @ 2024-12-22 33/week @ 2024-12-29 64/week @ 2025-01-05 28/week @ 2025-01-12 27/week @ 2025-01-19 21/week @ 2025-01-26 29/week @ 2025-02-02 37/week @ 2025-02-09 50/week @ 2025-02-16 136/week @ 2025-02-23 142/week @ 2025-03-02 188/week @ 2025-03-09 88/week @ 2025-03-16

558 downloads per month
Used in 3 crates

Apache-2.0 OR MIT

16KB
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

~235–690KB
~16K SLoC