From a5550d42031976823ea9c38653173365f5091302 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 23 Mar 2024 22:42:58 -0700 Subject: [PATCH] yaml: add YamlLoader::documents() to get a read-only view of the parsed documents --- saphyr/src/yaml.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/saphyr/src/yaml.rs b/saphyr/src/yaml.rs index 2ef4376..b869fcc 100644 --- a/saphyr/src/yaml.rs +++ b/saphyr/src/yaml.rs @@ -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`].