Sequence of nodes.
Style of the _sequence. If invalid, default _style will be used. If the node was loaded before, previous _style will always be used.
The represented node.
RepresenterException if a child could not be represented.
1 struct MyStruct 2 { 3 int x, y, z; 4 5 //Any D:YAML type must have a custom opCmp operator. 6 //This is used for ordering in mappings. 7 const int opCmp(ref const MyStruct s) 8 { 9 if(x != s.x){return x - s.x;} 10 if(y != s.y){return y - s.y;} 11 if(z != s.z){return z - s.z;} 12 return 0; 13 } 14 } 15 16 Node representMyStruct(ref Node node, Representer representer) 17 { 18 auto value = node.as!MyStruct; 19 auto nodes = [Node(value.x), Node(value.y), Node(value.z)]; 20 //use flow style 21 return representer.representSequence("!mystruct.tag", nodes, 22 CollectionStyle.Flow); 23 }
Represent a _sequence with specified _tag, representing children first.
This is used by representer functions that produce sequences.