#yaml #document #file #stream #individual #iterator #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

#1296 in Encoding

Download history 89/week @ 2023-12-18 44/week @ 2023-12-25 52/week @ 2024-01-01 76/week @ 2024-01-08 9/week @ 2024-01-15 32/week @ 2024-01-22 46/week @ 2024-01-29 42/week @ 2024-02-05 14/week @ 2024-02-12 111/week @ 2024-02-19 70/week @ 2024-02-26 41/week @ 2024-03-04 41/week @ 2024-03-11 127/week @ 2024-03-18 70/week @ 2024-03-25 182/week @ 2024-04-01

425 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

~310–760KB
~18K SLoC