2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
2018-05-03 13:05:06 +04:00
|
|
|
|
2018-05-03 09:52:30 +04:00
|
|
|
module Encoding =
|
|
|
|
struct
|
2018-05-03 08:27:17 +04:00
|
|
|
include Encoding
|
|
|
|
let splitted ~json ~binary = raw_splitted ~json:(Json.convert json) ~binary
|
2016-09-09 19:02:43 +04:00
|
|
|
let assoc enc =
|
2018-05-03 08:27:17 +04:00
|
|
|
let json = Json_encoding.assoc (Json.convert enc) in
|
2016-09-09 19:02:43 +04:00
|
|
|
let binary = list (tup2 string enc) in
|
|
|
|
raw_splitted ~json ~binary
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
include Encoding
|
|
|
|
|
2018-05-03 09:52:30 +04:00
|
|
|
module Json = Json
|
|
|
|
module Bson = Bson
|
2018-05-03 17:29:44 +04:00
|
|
|
module Binary = struct
|
|
|
|
include Binary
|
2018-05-12 18:57:39 +04:00
|
|
|
include Binary_error
|
|
|
|
include Binary_reader
|
|
|
|
include Binary_stream_reader
|
2018-05-03 17:29:44 +04:00
|
|
|
end
|
2018-05-03 08:27:17 +04:00
|
|
|
|
|
|
|
type json = Json.t
|
|
|
|
let json = Json.encoding
|
|
|
|
type json_schema = Json.schema
|
|
|
|
let json_schema = Json.schema_encoding
|
|
|
|
type bson = Bson.t
|