package containers

  1. Overview
  2. Docs

CBOR encoder/decoder.

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

note this is experimental.

  • since 3.9
type t = [
  1. | `Null
  2. | `Undefined
  3. | `Simple of int
  4. | `Bool of bool
  5. | `Int of int64
  6. | `Float of float
  7. | `Bytes of string
  8. | `Text of string
  9. | `Array of t list
  10. | `Map of (t * t) list
  11. | `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