Node.setStyle

Sets the style of this node when dumped.

  1. void setStyle(CollectionStyle style)
  2. void setStyle(ScalarStyle style)
    struct Node
    @safe
    @serdeIgnore
    void
    setStyle

Examples

import std.array: Appender;
import dyaml.dumper;
auto stream = new Appender!string();
auto node = Node([1, 2, 3, 4, 5]);
node.setStyle(CollectionStyle.block);

auto dumper = dumper();
dumper.dump(stream, node);
import std.array: Appender;
import dyaml.dumper;
auto stream = new Appender!string();
auto node = Node(4);
node.setStyle(ScalarStyle.literal);

auto dumper = dumper();
dumper.dump(stream, node);

Meta