Node.setStyle

Sets the style of this node when dumped.

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

Examples

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 dyaml.dumper;
auto stream = new Appender!string();
auto node = Node(4);
node.setStyle(ScalarStyle.literal);

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

Meta