diff --git a/ocaml/xapi/rpc_std_helpers.ml b/ocaml/xapi/rpc_std_helpers.ml index b837641ae92..9ca92c18106 100644 --- a/ocaml/xapi/rpc_std_helpers.ml +++ b/ocaml/xapi/rpc_std_helpers.ml @@ -1,5 +1,3 @@ -(** Helpers to marshal and unmarshal Rpc.Dict into Hashtbl *) - let rpc_of_hashtbl ~rpc_of t = let dict = Hashtbl.fold (fun k v acc -> (k, rpc_of v) :: acc) t [] in Rpc.Dict dict diff --git a/ocaml/xapi/rpc_std_helpers.mli b/ocaml/xapi/rpc_std_helpers.mli new file mode 100644 index 00000000000..21bc15149a2 --- /dev/null +++ b/ocaml/xapi/rpc_std_helpers.mli @@ -0,0 +1,5 @@ +(** Helpers to marshal and unmarshal Rpc.Dict into Hashtbl *) + +val rpc_of_hashtbl : rpc_of:('a -> Rpc.t) -> (string, 'a) Hashtbl.t -> Rpc.t + +val hashtbl_of_rpc : of_rpc:(Rpc.t -> 'a) -> Rpc.t -> (string, 'a) Hashtbl.t