Puts string part. The implementation allows to split string unicode points.
static struct Wrapper(T) { T value; void serialize(ISerializer serializer) const @safe { import mir.ser: serializeValue; serializeValue(serializer, value); } } static auto wrap(T)(T value) { return Wrapper!T(value); } import mir.ion.conv; import mir.ser.ion; import mir.ser.json; import mir.ser.text; import mir.ion.stream; import std.datetime.date; assert(wrap(Date(1234, 5, 6)).serializeJson == `"1234-05-06"`); assert(wrap(Date(1234, 5, 6)).serializeText == `1234-05-06`); assert(wrap(Date(1234, 5, 6)).serializeIon.ion2text == `1234-05-06`); immutable(ushort)[] imdata = [10, 20, 30]; assert(wrap(imdata).serializeIon.ion2text == `[10,20,30]`); const ubyte[] data = [0xe0, 0x01, 0x00, 0xea, 0xe9, 0x81, 0x83, 0xd6, 0x87, 0xb4, 0x81, 0x61, 0x81, 0x62, 0xd6, 0x8a, 0x21, 0x01, 0x8b, 0x21, 0x02]; auto json = wrap(data.IonValueStream).serializeJson; assert(json == `{"a":1,"b":2}`);
Serializer interface wrapper for common serializers.