Module Containers_cbor

CBOR encoder/decoder.

The type is chosen to be compatible with ocaml-cbor. See the RFC.

note this is experimental.

note this is only available on OCaml >= 4.08. Below that, the module is empty.

type t = [
| `Null
| `Undefined
| `Simple of int
| `Bool of bool
| `Int of int
| `Float of float
| `Bytes of string
| `Text of string
| `Array of t list
| `Map of (t * t) list
| `Tag of int * t
]
val pp_diagnostic : t CCFormat.printer
val to_string_diagnostic : t -> string
val encode : ?buf:Stdlib.Buffer.t -> t -> string
val decode : string -> ( t, string ) Stdlib.result
val decode_exn : string -> t

Like decode.

  • raises Failure

    if the string isn't valid