Macro yaml_peg::anchors[][src]

macro_rules! anchors {
    ($($k : expr => $v : expr), * $(,) ?) => { ... };
}
Expand description

Create a custom anchor visitor.

The anchor name should implement alloc::string::ToString trait. All items will convert to NodeBase automatically.

use yaml_peg::{node, anchors};

let v = anchors![
    "my-boss" => node!({"name" => "Henry"}),
];
assert_eq!(v["my-boss"]["name"], node!("Henry"));