Node.opIndex

inout(Node) opIndex(T)(T index) ref inout return scope @safe

Get the element at specified index.

If the node is a sequence, index must be integral.

If the node is a mapping, return the value corresponding to the first key equal to index. containsKey() can be used to determine if a mapping has a specific key.

To get element at a null index, use YAMLNull for index.

Parameters

indexIndex to use.

Returns

Value corresponding to the index.

Throws

NodeException if the index could not be found,

non-integral index is used with a sequence or the node is not a collection.