package ocaml-protoc-plugin

  1. Overview
  2. Docs
Plugin for protoc protobuf compiler to generate ocaml definitions from a .proto file

Install

dune-project
 Dependency

Authors

Maintainers

Sources

2.0.0.tar.gz
md5=64da59cf162da71c16aada2280a41679
sha512=20366714e30ff418b43034351c2560c72a7c99927959d412be7c579378af7f7b09f20c93ad07c816d23c86ebf53d5b56b3481cf38f13b6f0e1c5df5134aaf725

doc/src/ocaml-protoc-plugin/service.ml.html

Source file service.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module type Message = sig
  type t
  val from_proto: Reader.t -> t Result.t
  val to_proto: t -> Writer.t
end

let make_client_functions (type req) (type rep)
    ((module Request : Message with type t = req),
     (module Reply : Message with type t = rep)) =
  Request.to_proto, Reply.from_proto

let make_service_functions (type req) (type rep)
    ((module Request : Message with type t = req),
    (module Reply : Message with type t = rep)) =
  Request.from_proto, Reply.to_proto