Struct serde_kdl::Node [−][src]
pub struct Node(pub KdlNode);
Expand description
A newtype wrapper for KdlNode
with Serde support.
let doc = "parent 1 root=true { child 2 root=false; }";
let nodes: Vec<KdlNode> = kdl::parse_document(doc).unwrap();
let node: KdlNode = nodes[0].clone();
let json = serde_json::to_value(Node(node)).unwrap();
assert_eq!(json, json!({
"name": "parent",
"values": [1],
"properties": {
"root": true
},
"children": [
{
"name": "child",
"values": [2],
"properties": {
"root": false
},
"children": []
}
]
}));
Tuple Fields
0: KdlNode
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Node
impl UnwindSafe for Node
Blanket Implementations
Mutably borrows from an owned value. Read more