package ocaml-protoc-plugin

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

Install

Dune Dependency

Authors

Maintainers

Sources

4.0.0.tar.gz
md5=17124fa3e05c6c3785d928eaddd19bc5
sha512=e0c51df7cf869e2f9aef60ebee00daf4b0e1e5faed3936893fee1bd4d204967b3b5ffb802e430d05fd4bcbcf8491982b5eaa9e391258681d31fbed7b9368dde5

doc/src/ocaml-protoc-plugin.google_types/wrappers.ml.html

Source file wrappers.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
(************************************************)
(*       AUTOGENERATED FILE - DO NOT EDIT!      *)
(************************************************)
(* Generated by: ocaml-protoc-plugin            *)
(* https://github.com/issuu/ocaml-protoc-plugin *)
(************************************************)
(*
   Source: google/protobuf/wrappers.proto
   Syntax: proto3 
   Parameters:
     debug=false
     annot=''
     opens=[]
     int64_as_int=true
     int32_as_int=true
     fixed_as_int=false
     singleton_record=false
*)

open Ocaml_protoc_plugin.Runtime [@@warning "-33"]
module Google = struct
  module Protobuf = struct
    module rec DoubleValue : sig
      val name': unit -> string
      type t = float 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.DoubleValue"
      type t = float
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, double, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, double, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and FloatValue : sig
      val name': unit -> string
      type t = float 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.FloatValue"
      type t = float
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, float, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, float, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and Int64Value : sig
      val name': unit -> string
      type t = int 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.Int64Value"
      type t = int
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, int64_int, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, int64_int, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and UInt64Value : sig
      val name': unit -> string
      type t = int 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.UInt64Value"
      type t = int
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, uint64_int, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, uint64_int, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and Int32Value : sig
      val name': unit -> string
      type t = int 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.Int32Value"
      type t = int
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, int32_int, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, int32_int, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and UInt32Value : sig
      val name': unit -> string
      type t = int 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.UInt32Value"
      type t = int
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, uint32_int, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, uint32_int, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and BoolValue : sig
      val name': unit -> string
      type t = bool 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.BoolValue"
      type t = bool
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, bool, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, bool, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and StringValue : sig
      val name': unit -> string
      type t = string 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.StringValue"
      type t = string
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, string, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, string, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
    and BytesValue : sig
      val name': unit -> string
      type t = bytes 
      val to_proto: t -> Runtime'.Writer.t
      val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result
    end = struct 
      let name' () = "wrappers.google.protobuf.BytesValue"
      type t = bytes
      let to_proto =
        let apply = fun ~f a -> f [] a in
        let spec = Runtime'.Serialize.C.( basic (1, bytes, proto3) ^:: nil ) in
        let serialize = Runtime'.Serialize.serialize [] (spec) in
        fun t -> apply ~f:serialize t
      
      let from_proto =
        let constructor = fun _extensions a -> a in
        let spec = Runtime'.Deserialize.C.( basic (1, bytes, proto3) ^:: nil ) in
        let deserialize = Runtime'.Deserialize.deserialize [] spec constructor in
        fun writer -> deserialize writer |> Runtime'.Result.open_error
      
    end
  end
end
OCaml

Innovation. Community. Security.