Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.ion.value

struct IonVersionMarker;
Ion Version Marker
ushort major;
Major Version
ushort minor;
Minor Version
template IonType(IonTypeCode code : IonTypeCode.null_)

template IonType(IonTypeCode code : IonTypeCode.bool_)

template IonType(IonTypeCode code : IonTypeCode.uInt)

template IonType(IonTypeCode code : IonTypeCode.nInt)

template IonType(IonTypeCode code : IonTypeCode.float_)

template IonType(IonTypeCode code : IonTypeCode.decimal)

template IonType(IonTypeCode code : IonTypeCode.timestamp)

template IonType(IonTypeCode code : IonTypeCode.symbol)

template IonType(IonTypeCode code : IonTypeCode.string)

template IonType(IonTypeCode code : IonTypeCode.clob)

template IonType(IonTypeCode code : IonTypeCode.blob)

template IonType(IonTypeCode code : IonTypeCode.list)

template IonType(IonTypeCode code : IonTypeCode.sexp)

template IonType(IonTypeCode code : IonTypeCode.struct_)

template IonType(IonTypeCode code : IonTypeCode.annotations)
Aliases the to the corresponding Ion Typed Value type.
template IonTypeCodeOf(T : typeof(null))

template IonTypeCodeOf(T : IonBool)

template IonTypeCodeOf(T : IonUInt)

template IonTypeCodeOf(T : IonNInt)

template IonTypeCodeOf(T : IonFloat)

template IonTypeCodeOf(T : IonDecimal)

template IonTypeCodeOf(T : IonTimestampValue)

template IonTypeCodeOf(T : IonSymbolID)

template IonTypeCodeOf(T : IonString)

template IonTypeCodeOf(T : IonClob)

template IonTypeCodeOf(T : IonBlob)

template IonTypeCodeOf(T : IonList)

template IonTypeCodeOf(T : IonSexp)

template IonTypeCodeOf(T : IonStruct)

template IonTypeCodeOf(T : IonAnnotationWrapper)
Aliases the type to the corresponding .
enum auto isIonType(T);

enum auto isIonType(T : typeof(null));

enum auto isIonType(T : IonBool);

enum auto isIonType(T : IonUInt);

enum auto isIonType(T : IonNInt);

enum auto isIonType(T : IonFloat);

enum auto isIonType(T : IonDecimal);

enum auto isIonType(T : IonTimestampValue);

enum auto isIonType(T : IonSymbolID);

enum auto isIonType(T : IonString);

enum auto isIonType(T : IonClob);

enum auto isIonType(T : IonBlob);

enum auto isIonType(T : IonList);

enum auto isIonType(T : IonSexp);

enum auto isIonType(T : IonStruct);

enum auto isIonType(T : IonAnnotationWrapper);
A template to check if the type is one of Ion Typed Value types.
See Also:
struct IonValue;
Ion Value
The type descriptor octet has two subfields: a four-bit type code T, and a four-bit length L.
       7       4 3       0
---------+---------+
value |    T    |    L    |
---------+---------+======+
      :     length [VarUInt]     :
==========================+
      :      representation      :
==========================+
const pure nothrow @nogc @safe IonErrorCode describe(ref scope IonDescribedValue value);
Describes value (nothrow version).
Parameters:
IonDescribedValue value (out) IonDescribedValue
Returns:
const pure @nogc @safe IonDescribedValue describe();
Describes value.
const pure nothrow @safe IonValue gcCopy();
Returns:
GC-allocated copy.
struct IonDescriptor;
Ion Type Descriptor
const(ubyte)* reference;
The type descriptor octet has two subfields: a four-bit type code T, and a four-bit length L.
const pure nothrow @nogc @property @safe IonTypeCode type();
T
const pure nothrow @nogc @property @safe uint L();
L
struct IonDescribedValue;
Ion Described Value stores type descriptor and rerpresentation.
IonDescriptor descriptor;
Type Descriptor
const(ubyte)[] data;
Rerpresentation
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the blob is null.blob.
const pure nothrow @nogc @safe IonErrorCode get(T)(ref T value)
if (isIonType!T || is(T == IonInt));
Gets typed value (nothrow version).
Parameters:
T value (out) Ion Typed Value
Returns:
const pure @nogc @safe T get(T)()
if (isIonType!T || is(T == IonInt));
Gets typed value.
Returns:
Ion Typed Value
const pure nothrow @nogc @safe T trustedGet(T)()
if (isIonType!T || is(T == IonInt));
Gets typed value (nothrow internal version).
Returns:
Ion Typed Value

Note This function doesn't check the encoded value type.

struct IonIntField;
Ion integer field.
const(ubyte)[] data;
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isSigned!T);
Parameters:
T value (out) signed integer
Returns:
const pure @nogc @safe T get(T)()
if (isSigned!T);
Returns:
signed integer

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isSigned!T);
Returns:

Precondition this != null.

struct IonBool;
Nullable boolean type. Encodes false, true, and null.bool.
Examples:
assert(IonValue([0x1F]).describe.get!IonBool == null);
assert(IonValue([0x10]).describe.get!IonBool.get == false);
assert(IonValue([0x11]).describe.get!IonBool.get == true);
IonDescriptor descriptor;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the boolean is null.bool.
const pure nothrow @nogc @safe bool opEquals(bool rhs);
Parameters:
bool rhs right hand side value for == and != expressions.
Returns:
true if the boolean isn't null.bool and equals to the rhs.
const pure nothrow @nogc @safe bool get();
Returns:
bool

Precondition this != null.

struct IonUInt;
Ion non-negative integer number.
Examples:
assert(IonValue([0x2F]).describe.get!IonUInt == null);
assert(IonValue([0x21, 0x07]).describe.get!IonUInt.get!int == 7);

int v;
assert(IonValue([0x22, 0x01, 0x04]).describe.get!IonUInt.get(v) == IonErrorCode.none);
assert(v == 260);
BigUIntView!(const(ubyte), WordEndian.big) field;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the integer is null.int.
const pure nothrow @nogc @safe bool opEquals(ulong rhs);
Returns:
true if the integer isn't null.int and equals to rhs.
const pure nothrow @nogc @trusted IonErrorCode get(T)(ref scope T value)
if (isIntegral!T);
Parameters:
T value (out) unsigned or signed integer
Returns:

Precondition this != null.

const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:

Precondition this != null.

struct IonNInt;
Ion negative integer number.
Examples:
assert(IonValue([0x3F]).describe.get!IonNInt == null);
assert(IonValue([0x31, 0x07]).describe.get!IonNInt.get!int == -7);

long v;
assert(IonValue([0x32, 0x01, 0x04]).describe.get!IonNInt.get(v) == IonErrorCode.none);
assert(v == -260);

// IonNInt can't store zero according to the Ion Binary format specification.
assert(IonValue([0x30]).describe.get!IonNInt.getErrorCode!byte == IonErrorCode.overflowInIntegerValue);
BigUIntView!(const(ubyte), WordEndian.big) field;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the integer is null.int.
const pure nothrow @nogc @safe bool opEquals(long rhs);
Returns:
true if the integer isn't null.int and equals to rhs.
const pure nothrow @nogc @trusted IonErrorCode get(T)(ref scope T value)
if (isIntegral!T);
Parameters:
T value (out) signed or unsigned integer
Returns:

Precondition this != null.

const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:

Precondition this != null.

struct IonInt;
Ion signed integer number.
Examples:
test with IonUInts
import mir.ion.exception;

assert(IonValue([0x2F]).describe.get!IonInt == null);
assert(IonValue([0x21, 0x07]).describe.get!IonInt.get!int == 7);
assert(IonValue([0x20]).describe.get!IonInt.get!int == 0);

int v;
assert(IonValue([0x22, 0x01, 0x04]).describe.get!IonInt.get(v) == IonErrorCode.none);
assert(v == 260);
Examples:
test with IonNInts
import mir.ion.exception;

assert(IonValue([0x3F]).describe.get!IonInt == null);
assert(IonValue([0x31, 0x07]).describe.get!IonInt.get!int == -7);

long v;
assert(IonValue([0x32, 0x01, 0x04]).describe.get!IonInt.get(v) == IonErrorCode.none);
assert(v == -260);

// IonNInt can't store zero according to the Ion Binary format specification.
assert(IonValue([0x30]).describe.get!IonInt.getErrorCode!byte == IonErrorCode.overflowInIntegerValue);
BigIntView!(const(ubyte), WordEndian.big) field;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the integer is null.int.
const pure nothrow @nogc @trusted IonErrorCode get(T)(ref scope T value)
if (isIntegral!T);
Parameters:
T value (out) signed or unsigned integer
Returns:

Precondition this != null.

const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:

Precondition this != null.

struct IonFloat;
Ion floating point number.
Examples:
// null
assert(IonValue([0x4F]).describe.get!IonFloat == null);

// zero
auto ionFloat = IonValue([0x40]).describe.get!IonFloat;
assert(ionFloat.get!float == 0);
assert(ionFloat.get!double == 0);
assert(ionFloat.get!real == 0);

// single
ionFloat = IonValue([0x44, 0x42, 0xAA, 0x40, 0x00]).describe.get!IonFloat;
assert(ionFloat.get!float == 85.125);
assert(ionFloat.get!double == 85.125);
assert(ionFloat.get!real == 85.125);

// double
ionFloat = IonValue([0x48, 0x40, 0x55, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00]).describe.get!IonFloat;
assert(ionFloat.get!float == 85.125);
assert(ionFloat.get!double == 85.125);
assert(ionFloat.get!real == 85.125);
const(ubyte)[] data;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the float is null.float.
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isFloatingPoint!T);
Parameters:
T value (out) float, double, or real
Returns:

Precondition this != null.

const pure @nogc @safe T get(T)()
if (isFloatingPoint!T);
Returns:
floating point number

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isFloatingPoint!T);
Returns:

Precondition this != null.

struct IonDescribedDecimal;
int exponent;
IonIntField coefficient;
const pure nothrow @nogc @safe IonErrorCode getDecimal(size_t maxW64bitSize)(ref scope Decimal!maxW64bitSize value);
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isFloatingPoint!T && isMutable!T);
Parameters:
T value (out) floating point number
Returns:

Precondition this != null.

const pure @nogc @safe T get(T = double)()
if (isFloatingPoint!T);
Returns:
floating point number

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode()()
if (isFloatingPoint!T);
Returns:

Precondition this != null.

struct IonDecimal;
Ion described decimal number.
Examples:
// null.decimal
assert(IonValue([0x5F]).describe.get!IonDecimal == null);

auto describedDecimal = IonValue([0x56, 0x50, 0xcb, 0x80, 0xbc, 0x2d, 0x86]).describe.get!IonDecimal.get;
assert(describedDecimal.exponent == -2123);
assert(describedDecimal.coefficient.get!int == -12332422);

describedDecimal = IonValue([0x56, 0x00, 0xcb, 0x80, 0xbc, 0x2d, 0x86]).describe.get!IonDecimal.get;
assert(describedDecimal.get!double == -12332422e75);

assert(IonValue([0x50]).describe.get!IonDecimal.get!double == 0);
assert(IonValue([0x51, 0x83]).describe.get!IonDecimal.get!double == 0);
assert(IonValue([0x53, 0xc3, 0xb0, 0x39]).describe.get!IonDecimal.get!double == -12.345);
const(ubyte)[] data;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the decimal is null.decimal.
const pure nothrow @nogc @safe IonErrorCode get(T : IonDescribedDecimal)(ref scope T value);
Describes decimal (nothrow version).
Parameters:
T value (out) IonDescribedDecimal
Returns:
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isFloatingPoint!T);
Parameters:
T value (out) floating point number
Returns:

Precondition this != null.

const pure @nogc @safe T get(T = IonDescribedDecimal)();
Describes decimal.
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = IonDescribedDecimal)();
Returns:

Precondition this != null.

struct IonTimestampValue;
Ion Timestamp
Timestamp representations have 7 components, where 5 of these components are optional depending on the precision of the timestamp. The 2 non-optional components are offset and year. The 5 optional components are (from least precise to most precise): month, day, hour and minute, second, fraction_exponent and fraction_coefficient. All of these 7 components are in Universal Coordinated Time (UTC).
Examples:
import mir.ion.timestamp;

// null.timestamp
assert(IonValue([0x6F]).describe.get!IonTimestampValue == null);

ubyte[][] set = [
    [0x68, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84,         ], // 2000-07-08T02:03:04Z with no fractional seconds
    [0x69, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0x80,   ], // The same instant with 0d0 fractional seconds and implicit zero coefficient
    [0x6A, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0x80, 00], // The same instant with 0d0 fractional seconds and explicit zero coefficient
    [0x69, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0xC0,   ], // The same instant with 0d-0 fractional seconds
    [0x69, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0x81,   ], // The same instant with 0d1 fractional seconds
];

auto r = IonTimestamp(2000, 7, 8, 2, 3, 4);

foreach(data; set)
{
    assert(IonValue(data).describe.get!IonTimestampValue.get == r);
}

assert(IonValue([0x69, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0xC2])
    .describe
    .get!IonTimestampValue
    .get ==
        IonTimestamp(2000, 7, 8, 2, 3, 4, -2, 0));

assert(IonValue([0x6A, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0xC3, 0x10])
    .describe
    .get!IonTimestampValue
    .get ==
        IonTimestamp(2000, 7, 8, 2, 3, 4, -3, 16));
const(ubyte)[] data;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the timestamp is null.timestamp.
const pure nothrow @nogc @safe IonErrorCode get(T : IonTimestamp)(ref scope T value);
Describes decimal (nothrow version).
Parameters:
T value (out) IonTimestamp
Returns:
const pure @nogc @safe IonTimestamp get(T = IonTimestamp)();
Describes decimal.
Returns:
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = IonTimestamp)();
Returns:

Precondition this != null.

struct IonSymbolID;
Ion Symbol Id
In the binary encoding, all Ion symbols are stored as integer symbol IDs whose text values are provided by a symbol table. If L is zero then the symbol ID is zero and the length and symbol ID fields are omitted.
Examples:
assert(IonValue([0x7F]).describe.get!IonSymbolID == null);
assert(IonValue([0x71, 0x07]).describe.get!IonSymbolID.get == 7);

size_t v;
assert(IonValue([0x72, 0x01, 0x04]).describe.get!IonSymbolID.get(v) == IonErrorCode.none);
assert(v == 260);
BigUIntView!(const(ubyte), WordEndian.big) representation;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the symbol is null.symbol.
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isUnsigned!T);
Parameters:
T value (out) symbol id
Returns:

Precondition this != null.

const pure @nogc @safe T get(T = size_t)()
if (isUnsigned!T);
Returns:
unsigned or signed integer

Precondition this != null.

const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = size_t)()
if (isUnsigned!T);
Returns:

Precondition this != null.

struct IonString;
Ion String.
These are always sequences of Unicode characters, encoded as a sequence of UTF-8 octets.
Examples:
// null.string
assert(IonValue([0x8F]).describe.get!IonString == null);
// empty string
assert(IonValue([0x80]).describe.get!IonString != null);
assert(IonValue([0x80]).describe.get!IonString.data == "");

assert(IonValue([0x85, 0x63, 0x6f, 0x76, 0x69, 0x64]).describe.get!IonString.data == "covid");
const(char)[] data;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the string is null.string.
struct IonList;
Ion List (array)
Examples:
// check parsing with NOP padding:
// [NOP, int, NOP, double, NOP]
auto list = IonValue([0xbe, 0x91, 0x00, 0x00, 0x21, 0x0c, 0x00, 0x00, 0x48, 0x43, 0x0c, 0x6b, 0xf5, 0x26, 0x34, 0x00, 0x00, 0x00, 0x00])
    .describe.get!IonList;
size_t i;
foreach (elem; list)
{
    if (i == 0)
        assert(elem.get!IonUInt.get!int == 12);
    if (i == 1)
        assert(elem.get!IonFloat.get!double == 100e13);
    i++;
}
assert(i == 2);
const(ubyte)[] data;
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the sexp is null.sexp.
const pure nothrow @nogc @property @safe bool empty();
Returns:
true if the sexp is null.sexp, null, or ().

Note a NOP padding makes in the struct makes it non-empty.

const pure @nogc @safe int opApply(scope int delegate(IonDescribedValue value) pure @nogc @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonDescribedValue value) pure @safe dg);

const @trusted int opApply(scope int delegate(IonDescribedValue value) @safe dg);

const pure @nogc @system int opApply(scope int delegate(IonDescribedValue value) pure @nogc @system dg);

const @nogc @system int opApply(scope int delegate(IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonDescribedValue value) pure @system dg);

const @system int opApply(scope int delegate(IonDescribedValue value) @system dg);
const pure nothrow @nogc @safe int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @nogc @safe dg);

const nothrow @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @nogc @safe dg);

const pure @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @nogc @safe dg);

const pure nothrow @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @safe dg);

const nothrow @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @safe dg);

const @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @safe dg);

const pure nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @nogc @system dg);

const nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @nogc @system dg);

const pure @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @nogc @system dg);

const pure nothrow @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @system dg);

const @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @system dg);

const nothrow @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @system dg);

const @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @system dg);
struct IonSexp;
Ion Sexp (symbol expression, array)
Examples:
// check parsing with NOP padding:
// (NOP int NOP double NOP)
auto list = IonValue([0xce, 0x91, 0x00, 0x00, 0x21, 0x0c, 0x00, 0x00, 0x48, 0x43, 0x0c, 0x6b, 0xf5, 0x26, 0x34, 0x00, 0x00, 0x00, 0x00])
    .describe.get!IonSexp;
size_t i;
foreach (elem; list)
{
    if (i == 0)
        assert(elem.get!IonUInt.get!int == 12);
    if (i == 1)
        assert(elem.get!IonFloat.get!double == 100e13);
    i++;
}
assert(i == 2);
const(ubyte)[] data;
data view.
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the sexp is null.sexp.
const pure nothrow @nogc @property @safe bool empty();
Returns:
true if the sexp is null.sexp, null, or ().

Note a NOP padding makes in the struct makes it non-empty.

const pure @nogc @safe int opApply(scope int delegate(IonDescribedValue value) pure @nogc @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonDescribedValue value) pure @safe dg);

const @trusted int opApply(scope int delegate(IonDescribedValue value) @safe dg);

const pure @nogc @system int opApply(scope int delegate(IonDescribedValue value) pure @nogc @system dg);

const @nogc @system int opApply(scope int delegate(IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonDescribedValue value) pure @system dg);

const @system int opApply(scope int delegate(IonDescribedValue value) @system dg);
const pure nothrow @nogc @safe int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @nogc @safe dg);

const nothrow @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @nogc @safe dg);

const pure @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @nogc @safe dg);

const pure nothrow @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @safe dg);

const nothrow @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @safe dg);

const @trusted int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @safe dg);

const pure nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @nogc @system dg);

const nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @nogc @system dg);

const pure @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @nogc @system dg);

const pure nothrow @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure nothrow @system dg);

const @nogc @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) pure @system dg);

const nothrow @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) nothrow @system dg);

const @system int opApply(scope int delegate(IonErrorCode error, IonDescribedValue value) @system dg);
struct IonStruct;
Ion struct (object)
Examples:
// null.struct
assert(IonValue([0xDF]).describe.get!IonStruct == null);

// empty struct
auto ionStruct = IonValue([0xD0]).describe.get!IonStruct;
size_t i;
assert(ionStruct != null);
foreach (symbolID, elem; ionStruct)
    i++;
assert(i == 0);

// added two 2-bytes NOP padings 0x8F 0x00
ionStruct = IonValue([0xDE, 0x91, 0x8F, 0x00, 0x8A, 0x21, 0x0C, 0x8B, 0x48, 0x43, 0x0C, 0x6B, 0xF5, 0x26, 0x34, 0x00, 0x00, 0x8F, 0x00])
    .describe
    .get!IonStruct;

foreach (symbolID, elem; ionStruct)
{
    if (i == 0)
    {
        assert(symbolID == 10);
        assert(elem.get!IonUInt.get!int == 12);
    }
    if (i == 1)
    {
        assert(symbolID == 11);
        assert(elem.get!IonFloat.get!double == 100e13);
    }
    i++;
}
assert(i == 2);
IonDescriptor descriptor;
const(ubyte)[] data;
const pure nothrow @nogc @property @safe bool sorted();
const pure nothrow @nogc @safe bool opEquals(typeof(null));
Returns:
true if the struct is null.struct.
const pure nothrow @nogc @property @safe bool empty();
Returns:
true if the struct is null.struct, null, or ().

Note a NOP padding makes in the struct makes it non-empty.

const pure @nogc @safe int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) pure @nogc @safe dg);

const @nogc @trusted int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) pure @safe dg);

const @trusted int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) @safe dg);

const pure @nogc @system int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) pure @nogc @system dg);

const @nogc @system int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) pure @system dg);

const @system int opApply(scope int delegate(size_t symbolID, IonDescribedValue value) @system dg);
const pure nothrow @nogc @safe int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure nothrow @nogc @safe dg);

const nothrow @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) nothrow @nogc @safe dg);

const pure @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure @nogc @safe dg);

const pure nothrow @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure nothrow @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure @safe dg);

const nothrow @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) nothrow @safe dg);

const @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) @safe dg);

const pure nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure nothrow @nogc @system dg);

const nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) nothrow @nogc @system dg);

const pure @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure @nogc @system dg);

const pure nothrow @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure nothrow @system dg);

const @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) pure @system dg);

const nothrow @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) nothrow @system dg);

const @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID, IonDescribedValue value) @system dg);
struct IonAnnotationWrapper;
Ion Annotation Wrapper
Examples:
// null.struct
IonAnnotations annotations;
assert(IonValue([0xE7, 0x82, 0x8A, 0x8B, 0x53, 0xC3, 0x04, 0x65])
    .describe
    .get!IonAnnotationWrapper
    .unwrap(annotations)
    .get!IonDecimal
    .get!double == 1.125);

size_t i;
foreach (symbolID; annotations)
{
    if (i == 0)
    {
        assert(symbolID == 10);
    }
    if (i == 1)
    {
        assert(symbolID == 11);
    }
    i++;
}
assert(i == 2);
const(ubyte)[] data;
const pure nothrow @nogc @safe IonErrorCode unwrap(ref scope IonAnnotations annotations, ref scope IonDescribedValue value);

const pure nothrow @nogc @safe IonErrorCode unwrap(ref scope IonAnnotations annotations, ref scope IonValue value);
Unwraps Ion annotations (nothrow version).
Parameters:
IonAnnotations annotations (out) IonAnnotations
IonDescribedValue value (out, optional) IonDescribedValue or IonValue
Returns:
const pure @nogc @safe IonDescribedValue unwrap(ref scope IonAnnotations annotations);

const pure @nogc @safe IonDescribedValue unwrap();
Unwraps Ion annotations.
Parameters:
IonAnnotations annotations (optional out) IonAnnotations
struct IonAnnotations;
List of annotations represented as symbol IDs.
const(ubyte)[] data;
const pure nothrow @nogc @property @safe bool empty();
Returns:
true if no annotations provided.
const pure @nogc @safe int opApply(scope int delegate(size_t symbolID) pure @nogc @safe dg);

const @nogc @trusted int opApply(scope int delegate(size_t symbolID) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(size_t symbolID) pure @safe dg);

const @trusted int opApply(scope int delegate(size_t symbolID) @safe dg);

const pure @nogc @system int opApply(scope int delegate(size_t symbolID) pure @nogc @system dg);

const @nogc @system int opApply(scope int delegate(size_t symbolID) @nogc @system dg);

const pure @system int opApply(scope int delegate(size_t symbolID) pure @system dg);

const @system int opApply(scope int delegate(size_t symbolID) @system dg);
const pure nothrow @nogc @safe int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure nothrow @nogc @safe dg);

const nothrow @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) nothrow @nogc @safe dg);

const pure @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure @nogc @safe dg);

const pure nothrow @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure nothrow @safe dg);

const @nogc @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure @safe dg);

const nothrow @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) nothrow @safe dg);

const @trusted int opApply(scope int delegate(IonErrorCode error, size_t symbolID) @safe dg);

const pure nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure nothrow @nogc @system dg);

const nothrow @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) nothrow @nogc @system dg);

const pure @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure @nogc @system dg);

const pure nothrow @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure nothrow @system dg);

const @nogc @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) @nogc @system dg);

const pure @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) pure @system dg);

const nothrow @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) nothrow @system dg);

const @system int opApply(scope int delegate(IonErrorCode error, size_t symbolID) @system dg);