Skip to main content

Module document

Module document 

Source
Expand description

Multi-document loading and iteration. Multi-document YAML loading.

This module provides functionality for parsing YAML documents that contain multiple documents separated by ---.

§Examples

use noyalib::document::load_all;

let yaml = "---
name: doc1
---
name: doc2
";

let docs: Vec<_> = load_all(yaml).unwrap().collect();
assert_eq!(docs.len(), 2);

Structs§

DocumentIterator
An iterator over YAML documents in a string.
DocumentReadIteratorstd
Lazy iterator that yields Result<T> per YAML document parsed from a reader.

Functions§

load_all
Load all YAML documents from a string.
load_all_as
Load all YAML documents and deserialize them into a typed vector.
load_all_with_config
Load all YAML documents from a string with custom security limits.
readstd
Stream-decode every YAML document from a reader into typed values, yielding one Result<T> per document.
read_with_configstd
read with a custom ParserConfig for tightened security limits.
try_load_all
Load all YAML documents from a string, returning an error if parsing fails.