When deserializing a YAML document, the location and names of anchors and aliases is not preserved. That information is useful, though, as users may want to deduplicate references to the same mapping.
This commit introduces an API that exposes such mappings by parsing the metadata in struct Document. The new API has been added to struct Deserializer and provides the following signature:
When deserializing a YAML document, the location and names of anchors and aliases is not preserved. That information is useful, though, as users may want to deduplicate references to the same mapping.
This commit introduces an API that exposes such mappings by parsing the metadata in
struct Document
. The new API has been added tostruct Deserializer
and provides the following signature:pub fn anchors(&self) -> Option<Vec<DocumentAnchor>>
As an example, given the following YAML document:
this API returns: