yaml: add YamlLoader::documents() to get a read-only view of the parsed documents

This commit is contained in:
David Aguilar 2024-03-23 22:42:58 -07:00
parent ee92e953f1
commit 16f3ea39e1

View file

@ -239,6 +239,12 @@ impl YamlLoader {
parser.load(&mut loader, true)?;
Ok(loader.docs)
}
/// Return a reference to the parsed Yaml documents.
#[must_use]
pub fn documents(&self) -> &[Yaml] {
&self.docs
}
}
/// The signature of the function to call when using [`YAMLDecodingTrap::Call`].