Module Standards.MsgPack

Description

Tools for handling the MsgPack data format. MsgPack is a binary serialization format with applications similar to JSON. However, MsgPack is more versatile and is able to serialize arbitrary objects using an extension format. The following table shows how some special Pike data types are encoded in the MsgPack format. All basic types, namely int, string, float, array and mapping are mapped onto their natural MsgPack counterparts. Note that the encoder does not use all integer and floating point lengths and in particular integers are never encoded as unsigned.

All other types can be encoded and decoded using extension handlers.


Typedef decode_handler

typedef function(int(-127..128), Stdio.Buffer:mixed) Standards.MsgPack.decode_handler

Description

Function prototype for decode extension handlers. The first argument is the extension type identifier. The second argument is a Stdio.Buffer containing the payload.

See also

decode, decode_from


Typedef encode_handler

typedef function(Stdio.Buffer, mixed:void) Standards.MsgPack.encode_handler

Description

Function prototype for encode extension handlers. The first argument is the Stdio.Buffer, the second the value to encode. Use add_extension_header to generate the correct extension header.

See also

decode, decode_from