Skip to main content

Module msgpack

Module msgpack 

Source
Expand description

msgpack primitives that make msgspec’s encoding choices.

The Python side encodes with msgspec, which always picks the smallest integer, string, binary, array, map and ext format and writes every float as float64. Encoder makes the same choices, so a message decoded and re-encoded here is byte-identical to the Python encoding. Decoder accepts every msgpack format, as msgspec’s decoder does.

A message is a list of ZMQ frames: frame 0 is the msgpack buffer, and large tensors ride in further frames that the buffer references by index (see crate::tensor).

Structs§

Decoder
Reads one message from its frames.
Encoder
Writes one message: the msgpack buffer plus out-of-band frames.

Enums§

Integer
An integer as read from the wire, before narrowing to a schema type.
Kind
The msgpack type of the next value, for decoding unions.

Constants§

INLINE_THRESHOLD
Tensors smaller than this many bytes are inlined in the msgpack buffer; larger ones become their own frame. Matches MSGPACK_ZERO_COPY_THRESHOLD.