package msgpck

  1. Overview
  2. Docs
Fast MessagePack (http://msgpack.org) library

Install

Dune Dependency

Authors

Maintainers

Sources

msgpck-v1.7.tbz
sha256=ff7065bf590af502a1b1622ff3b5280805c122033d68cf6b53da32c31ecb5f5d
sha512=7d71baa9614f890f669bb52181a295e51d6735ab9786fd7bc69c123721f801232a314ec98b8e59ccf8d2c1541f8fcc084ebf1d47189fd45632621c4a246d0368

doc/msgpck/Msgpck/StringBuf/index.html

Module Msgpck.StringBufSource

MessagePack library decoding from strings and writing in Buffers.

Sourcetype buf_in = string

Type of input buffer (where MessagePack data will be read)

Sourcetype buf_out = Buffer.t

Type of output buffer (where MessagePack data will be written)

Sourceval read : ?pos:int -> buf_in -> int * t

read ?pos buf is (nb_read, t), where nb_read is the number of bytes read from buf at pos ?pos, and t is the decoded MessagePack value.

@raise Invalid_argument "msg" when there is no valid MessagePack value to be read from buf at position pos.

Sourceval read_all : ?pos:int -> buf_in -> int * t list

read_all ?pos buf reads all messages found in buf.

  • returns

    a tuple (pos, l) where pos is the new position in the buffer, and l is the list of read messages.

@raise Invalid_argument "msg" when there is no valid MessagePack value to be read from buf at position pos.

Sourceval write : ?pos:int -> buf_out -> t -> int

write ?pos buf msg is nb_written, the number of bytes written on buf at position ?pos. The serialization of msg have been written to buf starting at ?pos.

Sourceval to_string : t -> buf_out

to_string msg is the MessagePack serialization of msg.

OCaml

Innovation. Community. Security.