package ocaml-protoc-plugin
Plugin for protoc protobuf compiler to generate ocaml definitions from a .proto file
Install
Dune Dependency
Authors
Maintainers
Sources
4.5.0.tar.gz
md5=c374c68c6c2552c2c25484c2edbc9f6a
sha512=85f77afe95e56a90aabb037b4a96ddb903ee5d2732552838da3e22de6a4189bdd8c22a380e2489e99b85041a204c2cdda88568742cece012958f23c802b5c370
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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
(************************************************) (* 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 make : ?value:float -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0. in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:float -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0. in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:int -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0 in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:int -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0 in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:int -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0 in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:int -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> 0 in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:bool -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> false in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:string -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> {||} in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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 make : ?value:bytes -> unit -> t 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 make = fun ?value () -> let value = match value with Some v -> v | None -> (Bytes.of_string {||}) in value let to_proto = let apply = fun ~f:f' value -> f' [] value 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 value -> value 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
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>