2018-02-08 13:51:02 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
open Error_monad
|
|
|
|
|
2018-02-11 22:17:40 +04:00
|
|
|
class type ['pr] gen_simple = object
|
2018-02-08 13:51:02 +04:00
|
|
|
method call_service :
|
|
|
|
'm 'p 'q 'i 'o.
|
2018-02-11 22:17:40 +04:00
|
|
|
([< Resto.meth ] as 'm, 'pr, 'p, 'q, 'i, 'o) RPC_service.t ->
|
2018-02-08 13:51:02 +04:00
|
|
|
'p -> 'q -> 'i -> 'o tzresult Lwt.t
|
|
|
|
end
|
|
|
|
|
2018-02-11 22:17:40 +04:00
|
|
|
class type ['pr] gen_streamed = object
|
2018-02-08 13:51:02 +04:00
|
|
|
method call_streamed_service :
|
|
|
|
'm 'p 'q 'i 'o.
|
2018-02-11 22:17:40 +04:00
|
|
|
([< Resto.meth ] as 'm, 'pr, 'p, 'q, 'i, 'o) RPC_service.t ->
|
2018-02-08 13:51:02 +04:00
|
|
|
on_chunk: ('o -> unit) ->
|
|
|
|
on_close: (unit -> unit) ->
|
|
|
|
'p -> 'q -> 'i -> (unit -> unit) tzresult Lwt.t
|
|
|
|
end
|
|
|
|
|
2018-02-11 22:17:40 +04:00
|
|
|
class type ['pr] gen = object
|
|
|
|
inherit ['pr] gen_simple
|
|
|
|
inherit ['pr] gen_streamed
|
|
|
|
end
|
|
|
|
|
|
|
|
class type simple = object
|
|
|
|
inherit [unit] gen_simple
|
|
|
|
end
|
|
|
|
|
|
|
|
class type streamed = object
|
|
|
|
inherit [unit] gen_streamed
|
|
|
|
end
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
class type t = object
|
|
|
|
inherit simple
|
|
|
|
inherit streamed
|
|
|
|
end
|
|
|
|
|
2018-02-11 22:17:40 +04:00
|
|
|
class ['pr] of_directory : 'pr RPC_directory.t -> ['pr] gen
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
type error +=
|
|
|
|
| Not_found of { meth: RPC_service.meth ;
|
|
|
|
uri: Uri.t }
|
|
|
|
| Generic_error of { meth: RPC_service.meth ;
|
|
|
|
uri: Uri.t }
|
|
|
|
|
|
|
|
val make_call :
|
|
|
|
([< Resto.meth ], unit, 'p, 'q, 'i, 'o) RPC_service.t ->
|
|
|
|
#simple -> 'p -> 'q -> 'i -> 'o tzresult Lwt.t
|
|
|
|
|
|
|
|
val make_call1 :
|
|
|
|
([< Resto.meth ], unit, unit * 'a, 'q, 'i, 'o) RPC_service.t ->
|
|
|
|
#simple -> 'a -> 'q -> 'i -> 'o tzresult Lwt.t
|
|
|
|
|
|
|
|
val make_call2 :
|
|
|
|
([< Resto.meth ], unit, (unit * 'a) * 'b, 'q, 'i, 'o) RPC_service.t ->
|
|
|
|
#simple -> 'a -> 'b -> 'q -> 'i -> 'o tzresult Lwt.t
|
|
|
|
|
|
|
|
val make_call3 :
|
|
|
|
([< Resto.meth ], unit, ((unit * 'a) * 'b) * 'c, 'q, 'i, 'o) RPC_service.t ->
|
|
|
|
#simple -> 'a -> 'b -> 'c -> 'q -> 'i -> 'o tzresult Lwt.t
|
|
|
|
|
|
|
|
type stopper = unit -> unit
|
|
|
|
|
|
|
|
val make_streamed_call :
|
|
|
|
([< Resto.meth ], unit, 'p, 'q, 'i, 'o) RPC_service.t ->
|
|
|
|
#streamed -> 'p -> 'q -> 'i ->
|
|
|
|
('o Lwt_stream.t * stopper) tzresult Lwt.t
|
2018-02-11 22:17:40 +04:00
|
|
|
|