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
ubyte major;
Major Version
ubyte 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 : IonNull)

template IonTypeCodeOf(T : bool)

template IonTypeCodeOf(T : IonUInt)

template IonTypeCodeOf(T : IonNInt)

template IonTypeCodeOf(T : IonFloat)

template IonTypeCodeOf(T : IonDecimal)

template IonTypeCodeOf(T : IonTimestamp)

template IonTypeCodeOf(T : IonSymbolID)

template IonTypeCodeOf(T : const(char)[])

template IonTypeCodeOf(T : Clob)

template IonTypeCodeOf(T : Blob)

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 : IonNull);

enum auto isIonType(T : bool);

enum auto isIonType(T : IonUInt);

enum auto isIonType(T : IonNInt);

enum auto isIonType(T : IonFloat);

enum auto isIonType(T : IonDecimal);

enum auto isIonType(T : IonTimestamp);

enum auto isIonType(T : IonSymbolID);

enum auto isIonType(T : const(char)[]);

enum auto isIonType(T : Clob);

enum auto isIonType(T : Blob);

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 IonNull;
Ion null value.
IonTypeCode code;
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
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      :
==========================+
Examples:
import mir.lob;
import mir.ion.type_code;
import mir.ion.value;
// null.string
assert(IonValue([0x9F]).describe.get!IonNull == IonNull(IonTypeCode.clob));
// empty string
assert(IonValue([0x90]).describe.get!Clob.data == "");

assert(IonValue([0x95, 0x63, 0x6f, 0x76, 0x69, 0x64]).describe.get!Clob.data == "covid");
Examples:
import mir.lob;
import mir.ion.type_code;
import mir.ion.value;
// null.string
assert(IonValue([0xAF]).describe.get!IonNull == IonNull(IonTypeCode.blob));
// empty string
assert(IonValue([0xA0]).describe.get!Blob.data == "");

assert(IonValue([0xA5, 0x63, 0x6f, 0x76, 0x69, 0x64]).describe.get!Blob.data == "covid");
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 void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
Examples:
import mir.ion.stream;
import mir.ser.json;
assert(IonValueStream([0x11]).serializeJson == "true");
struct IonDescriptor;
Ion Type Descriptor
pure nothrow @nogc @safe this(scope const(ubyte)* reference);
The type descriptor octet has two subfields: a four-bit type code T, and a four-bit length L.
IonTypeCode type;
T
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 value is any Ion null.
const pure nothrow @nogc @safe bool opEquals()(IonDescribedValue rhs);
Returns:
true if the values have the same binary representation.
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.

const @safe void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
struct IonIntField;
Ion integer field.
Examples:
assert(IonValue([0x1F]).describe.get!IonNull.code == IonTypeCode.bool_);
assert(IonValue([0x10]).describe.get!bool == false);
assert(IonValue([0x11]).describe.get!bool == true);
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 IonUInt;
Ion non-negative integer number.
Examples:
assert(IonValue([0x2F]).describe.get!IonNull == IonNull(IonTypeCode.uInt));
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(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:
const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:
struct IonNInt;
Ion negative integer number.
Examples:
assert(IonValue([0x3F]).describe.get!IonNull == IonNull(IonTypeCode.nInt));
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(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:
const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:
struct IonInt;
Ion signed integer number.
Examples:
test with IonUInts
import mir.ion.exception;

assert(IonValue([0x2F]).describe.get!IonNull == IonNull(IonTypeCode.uInt));
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!IonNull == IonNull(IonTypeCode.nInt));
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 @trusted IonErrorCode get(T)(ref scope T value)
if (isIntegral!T);
Parameters:
T value (out) signed or unsigned integer
Returns:
const pure @nogc @safe T get(T)()
if (isIntegral!T);
Returns:
unsigned or signed integer
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isIntegral!T);
Returns:
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
struct IonFloat;
Ion floating point number.
Examples:
// null
assert(IonValue([0x4F]).describe.get!IonNull == IonNull(IonTypeCode.float_));

// 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 IonErrorCode get(T)(ref scope T value)
if (isFloatingPoint!T);
Parameters:
T value (out) float, double, or real
Returns:
const pure @nogc @safe T get(T)()
if (isFloatingPoint!T);
Returns:
floating point number
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T)()
if (isFloatingPoint!T);
Returns:
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
struct IonDescribedDecimal;
int exponent;
IonIntField coefficient;
const pure nothrow @nogc @safe IonErrorCode get(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:
const pure @nogc @safe T get(T = double)()
if (isFloatingPoint!T);
Returns:
floating point number
const pure nothrow @nogc @trusted IonErrorCode getErrorCode()()
if (isFloatingPoint!T);
Returns:
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
struct IonDecimal;
Ion described decimal number.
Examples:
// null.decimal
assert(IonValue([0x5F]).describe.get!IonNull == IonNull(IonTypeCode.decimal));

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 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:
const pure @nogc @safe T get(T = IonDescribedDecimal)();
Describes decimal.
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = IonDescribedDecimal)();
Returns:
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
struct IonTimestamp;
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.timestamp;

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

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 = Timestamp(2000, 7, 8, 2, 3, 4);

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

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

assert(IonValue([0x6A, 0x80, 0x0F, 0xD0, 0x87, 0x88, 0x82, 0x83, 0x84, 0xC3, 0x10])
    .describe
    .get!IonTimestamp
    .get ==
        Timestamp(2000, 7, 8, 2, 3, 4, -3, 16));
const(ubyte)[] data;
const pure nothrow @nogc @safe IonErrorCode get(T : Timestamp)(ref scope T value);
Describes decimal (nothrow version).
Parameters:
T value (out) Timestamp 
Returns:
const pure @nogc @safe Timestamp get(T = Timestamp)();
Describes decimal.
Returns:
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = Timestamp)();
Returns:
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
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!IonNull == IonNull(IonTypeCode.symbol));
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);
Examples:
// null.string
assert(IonValue([0x8F]).describe.get!IonNull == IonNull(IonTypeCode.string));
// empty string
assert(IonValue([0x80]).describe.get!(const(char)[]) !is null);
assert(IonValue([0x80]).describe.get!(const(char)[]) == "");

assert(IonValue([0x85, 0x63, 0x6f, 0x76, 0x69, 0x64]).describe.get!(const(char)[]) == "covid");
BigUIntView!(const(ubyte), WordEndian.big) representation;
const pure nothrow @nogc @safe IonErrorCode get(T)(ref scope T value)
if (isUnsigned!T);
Parameters:
T value (out) symbol id
Returns:
const pure @nogc @safe T get(T = size_t)()
if (isUnsigned!T);
Returns:
unsigned or signed integer
const pure nothrow @nogc @trusted IonErrorCode getErrorCode(T = size_t)()
if (isUnsigned!T);
Returns:
const void serialize(S)(ref S serializer);
Serializes SymbolId as Ion value.

Note This serialization shouldn't be used for struct keys or annotation list.

Parameters:
S serializer serializer with putSymbolId primitive.
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 @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);
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
const pure @nogc @property @safe size_t walkLength();
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 @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);
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
const pure @nogc @property @safe size_t walkLength();
struct IonElementWithId;
, and symbol id triplet used in the IonList and IonSexp.
IonDescribedValue value;
Ion described value
IonErrorCode error;
Error code
size_t id;
Symbol ID
struct IonElement;
and pair used in the IonList and IonSexp/
IonDescribedValue value;
Ion described value
IonErrorCode error;
Error code
struct IonStruct;
Ion struct (object)
Examples:
// null.struct
assert(IonValue([0xDF]).describe.get!IonNull == IonNull(IonTypeCode.struct_));

// empty struct
auto ionStruct = IonValue([0xD0]).describe.get!IonStruct;
size_t i;
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 @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);
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
const pure nothrow @nogc @safe IonStructWithSymbols withSymbols(return scope const(char[])[] symbolTable) return;
const pure @nogc @property @safe size_t walkLength();
struct IonStructWithSymbols;
Ion struct (object) with a symbol table
IonStruct ionStruct;
const(char[])[] symbolTable;
const pure nothrow @nogc @property @safe bool sorted();
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(scope const(char)[] symbol, IonDescribedValue value) pure @nogc @safe dg);

const @nogc @trusted int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) @nogc @safe dg);

const pure @trusted int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) pure @safe dg);

const @trusted int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) @safe dg);

const pure @nogc @system int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) pure @nogc @system dg);

const @nogc @system int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) @nogc @system dg);

const pure @system int opApply(scope int delegate(scope const(char)[] symbol, IonDescribedValue value) pure @system dg);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const @system int opApply(scope int delegate(IonErrorCode error, scope const(char)[] symbol, IonDescribedValue value) @system dg);
const pure @safe auto opIndex(scope const(char)[] symbol);
const pure @nogc @safe Nullable!IonDescribedValue opBinaryRight(string op : "in")(scope const(char)[] symbol);
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
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
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer
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.
pure nothrow @nogc @safe IonErrorCode pick(ref size_t symbolID);
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);
const void serialize(S)(ref S serializer);
Parameters:
S serializer serializer