yaml: add YamlLoader::documents() to get a read-only view of the parsed documents
This commit is contained in:
parent
ee92e953f1
commit
16f3ea39e1
1 changed files with 6 additions and 0 deletions
|
@ -239,6 +239,12 @@ impl YamlLoader {
|
||||||
parser.load(&mut loader, true)?;
|
parser.load(&mut loader, true)?;
|
||||||
Ok(loader.docs)
|
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`].
|
/// The signature of the function to call when using [`YAMLDecodingTrap::Call`].
|
||||||
|
|
Loading…
Reference in a new issue