msgpack

MessagePack serializer and deserializer implementation.

MessagePack is a binary-based serialization specification.

Members

Aliases

Packer
alias Packer = PackerImpl!(Appender!(ubyte[]))

Default serializer

Classes

MessagePackException
class MessagePackException

MessagePackException is a root Exception for MessagePack related operation.

UnpackException
class UnpackException

UnpackException is thrown on deserialization failure

Functions

pack
ubyte[] pack(Args args)

Serializes args.

packer
PackerImpl!(Stream) packer(Stream stream, bool withFieldName)

Helper for Packer construction.

registerPackHandler
void registerPackHandler()

Register a serialization handler for T type

registerUnpackHandler
void registerUnpackHandler()

Register a deserialization handler for T type

unpack
Unpacked unpack(ubyte[] buffer)

Deserializes buffer using stream deserializer.

unpack
void unpack(ubyte[] buffer, Args args)

Deserializes buffer using direct-conversion deserializer.

unpack
Type unpack(ubyte[] buffer)

Return value version

Manifest constants

EnableReal
enum EnableReal;
Undocumented in source.
EnableReal
enum EnableReal;
Undocumented in source.

Mixin templates

DefineDictionalPacker
mixintemplate DefineDictionalPacker()
Undocumented in source.
DefinePacker
mixintemplate DefinePacker()
Undocumented in source.
InternalBuffer
mixintemplate InternalBuffer()

Internal buffer and related operations for Unpacker

MessagePackable
mixintemplate MessagePackable(Members...)

Handy helper for creating MessagePackable object.

Structs

PackerImpl
struct PackerImpl(Stream)

Packer is a MessagePack serializer

RefBuffer
struct RefBuffer

RefBuffer is a reference stored buffer for more efficient serialization

StreamingUnpacker
struct StreamingUnpacker

This StreamingUnpacker is a MessagePack streaming deserializer

Unpacked
struct Unpacked

Unpacked is a Range wrapper for stream deserialization result

Unpacker
struct Unpacker

This Unpacker is a MessagePack direct-conversion deserializer

Value
struct Value

Value is a MessagePack value representation

iovec
struct iovec

from core.sys.posix.sys.uio.iovec for compatibility with posix.

nonPacked
struct nonPacked

Attribute for specifying non pack/unpack field. This is an alternative approach of MessagePackable mixin.

Templates

isPackedField
template isPackedField(alias field)
Undocumented in source.

Examples

auto data = tuple("MessagePack!", [1, 2], true);

auto serialized = pack(data);

// ...

typeof(data) deserialized;

unpack(serialized, deserialized);

assert(data == deserialized);

See Also

Meta

License

<a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.

Authors

Masahiro Nakagawa