yaml: add YamlLoader::documents() to get a read-only view of the parsed documents
This commit is contained in:
parent
eddea11e01
commit
a5550d4203
1 changed files with 6 additions and 0 deletions
|
@ -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`].
|
||||
|
|
Loading…
Reference in a new issue