Function yaml_peg::parser::parse_arc [−][src]
pub fn parse_arc(
doc: &str
) -> Result<(Array<ArcRepr>, AnchorBase<ArcRepr>), String>
Expand description
Parse YAML document into alloc::sync::Arc
data holder.
Return an array of nodes and the anchors.
use yaml_peg::{parse_arc, node_arc};
let doc = "
---
name: Bob
married: true
age: 46
";
let (n, anchors) = parse_arc(doc).unwrap();
assert_eq!(anchors.len(), 0);
assert_eq!(n, vec![node_arc!({
"name" => "Bob",
"married" => true,
"age" => 46,
})]);