Node.this

Construct a Node from a value.

Any type except for Node can be stored in a Node, but default YAML types (integers, floats, strings, timestamps, etc.) will be stored more efficiently. To create a node representing a null value, construct it from YAMLNull.

More...
  1. this(T value, const string tag = null)
  2. this(T value, const string tag = null)
    struct Node
    this
    @trusted pure nothrow
    (
    T
    )
    (
    ,
    const string tag = null
    )
    if (
    scalarCtorNothrow!T
    )
  3. this(T[] array, const string tag = null)
  4. this(V[K] array, const string tag = null)
  5. this(K[] keys, V[] values, const string tag = null)

Parameters

tag
Type: string

Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. Tag must be in full form, e.g. "tag:yaml.org,2002:int", not a shortcut, like "!!int".

Detailed Description

Note that to emit any non-default types you store in a node, you need a Representer to represent them in YAML - otherwise emitting will fail.

Meta