2021-09-29 14:34:09 +00:00
|
|
|
(** CBOR encoder/decoder, RFC 7049 *)
|
|
|
|
|
|
|
|
exception Error of string
|
|
|
|
|
2021-10-08 16:49:18 +00:00
|
|
|
exception Noncanonical of string
|
|
|
|
|
2021-09-29 14:34:09 +00:00
|
|
|
module Simple : sig
|
|
|
|
|
|
|
|
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
|
|
|
|
]
|
|
|
|
|
|
|
|
val encode : t -> string
|
|
|
|
val decode : string -> t
|
|
|
|
val decode_partial : string -> t * string
|
|
|
|
|
|
|
|
val to_diagnostic : t -> string
|
|
|
|
|
|
|
|
end
|