MessagePack
(require messagepack) | package: messagepack-lib |
This module provides an implementation of the MessagePack serialization format. Data is converted between MessagePack and Racket according to the following table:
MsgPack Type | Racket Contract |
nil | |
bool | |
int | (integer-in (- (expt 2 63)) (sub1 (expt 2 64))) |
float | |
bin | |
string | |
array | |
map | |
timestamp |
When serializing integer values to MessagePack, the library chooses the shortest representation available.
procedure
(msgpack-nil? v) → boolean?
v : any/c
value
procedure
(read-msgpack in) → any/c
in : input-port?
Extensions may be handled by parameterizing current-msgpack-ext-read-handler.
procedure
(write-msgpack v [out]) → void?
v : any/c out : output-port? = (current-output-port)
Extensions may be handled by parameterizing current-msgpack-ext-write-handler.
parameter
→ (-> (integer-in 0 127) bytes? any/c) (current-msgpack-ext-read-handler handler) → void? handler : (-> (integer-in 0 127) bytes? any/c)
= #f
The default implementation raises an exception when called.
parameter
→ (-> any/c (values (integer-in 0 127) bytes?)) (current-msgpack-ext-write-handler handler) → void? handler : (-> any/c (values (integer-in 0 127) bytes?))
= #f
The default implementation raises an exception when called.