package msgpck

  1. Overview
  2. Docs

msgpack library for OCaml

1.7 — homepage

Msgpck

type t =
  1. | Nil
  2. | Bool of bool
  3. | Int of int
  4. | Uint32 of int32
  5. | Int32 of int32
  6. | Uint64 of int64
  7. | Int64 of int64
  8. | Float32 of int32
  9. | Float of float
  10. | String of string
  11. | Bytes of string
  12. | Ext of int * string
  13. | List of t list
  14. | Map of (t * t) list
    (*

    MessagePack types.

    *)
val compare : t -> t -> int
val equal : t -> t -> bool
val size : t -> int

size msg is the size in bytes of the MessagePack serialization of message msg.

val pp : Stdlib.Format.formatter -> t -> unit
val show : t -> string

Conversion functions OCaml -> MessagePack

val of_nil : t
val of_bool : bool -> t
val of_int : int -> t
val of_uint32 : int32 -> t
val of_int32 : int32 -> t
val of_uint64 : int64 -> t
val of_int64 : int64 -> t
val of_float32 : int32 -> t
val of_float : float -> t
val of_string : string -> t
val of_bytes : string -> t
val of_ext : int -> string -> t
val of_list : t list -> t
val of_map : (t * t) list -> t

Conversion functions MessagePack -> OCaml

val to_nil : t -> unit
val to_bool : t -> bool
val to_int : t -> int
val to_uint32 : t -> int32
val to_int32 : t -> int32
val to_uint64 : t -> int64
val to_int64 : t -> int64
val to_float32 : t -> int32
val to_float : t -> float
val to_string : t -> string
val to_bytes : t -> string
val to_ext : t -> int * string
val to_list : t -> t list
val to_map : t -> (t * t) list

Output signature for functors defined below

module type S = sig ... end
module StringBuf : S with type buf_in = string and type buf_out = Stdlib.Buffer.t

MessagePack library decoding from strings and writing in Buffers.

module BytesBuf : S with type buf_in = Stdlib.Bytes.t and type buf_out = Stdlib.Buffer.t

MessagePack library decoding from bytes and writing in Buffers.

module String : S with type buf_in = string and type buf_out = Stdlib.Bytes.t

MessagePack library decoding from strings and writing in bytes.

module Bytes : S with type buf_in = Stdlib.Bytes.t and type buf_out = Stdlib.Bytes.t

MessagePack library decoding from bytes and writing in bytes.