ppx_deriving_rpc

AuthorThomas Gazagnaire, Jon Ludlam
Homepagehttps://github.com/mirage/ocaml-rpc
Issue Trackerhttps://github.com/mirage/ocaml-rpc/issues
Tagsorg:mirage and org:xapi-project
Maintainerthomas@gazagnaire.org
Dependencies
&async
cppo
jbuilder
lwt>= 3.0.0
ppx_deriving
ppx_tools
ppxfind
rpclib>= 5.0.0
rpclib-async>= 5.0.0
rpclib-lwt>= 5.0.0
rresult
Availableocaml-version >= "4.03.0"
PublishedAug 6, 2018
Source [http] https://github.com/mirage/ocaml-rpc/archive/v5.9.0.tar.gz
177db71621a7aa7a55cbea6c237eb6dc
StatisticsInstalled 5 times last month.
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/ppx_deriving_rpc/ppx_deriving_rpc.5.9.0/opam

ppx extension for rpclib

The library provides the [@@deriving rpc] ppx directly generates the conversion functions.

type t = ... [@@deriving rpc]

will give two functions:

  • A function to convert values of type t to values of type Rpc.t : val rpc_of_t : t -> Rpc.t

  • A function to convert values of type Rpc.t to values of type t : val t_of_rpc : Rpc.t -> (t,string) Result.result

It also supports the @key annotations for having different field names:

type t = { foo: int [@key "type"]; bar: int [@key "let"]; } [@@deriving rpc]
No package is dependent