package ocaml-protoc-plugin
Plugin for protoc protobuf compiler to generate ocaml definitions from a .proto file
Install
Dune Dependency
Authors
Maintainers
Sources
ocaml-protoc-plugin-5.0.0.tbz
sha256=1fe1eaf485463d8deefd53f1c0cef0e5b58fe10d3cafbcea449b9855f648e12c
sha512=05003453cc9c52138559ef93a69bbac84b9c82c2c173c52128b49805da6db9df1038d66aee21f6931fcb090e502589ad78225ab21a32b8120e2bffea9899be7c
doc/src/ocaml-protoc-plugin.google_types/duration.ml.html
Source file duration.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
(********************************************************) (* AUTOGENERATED FILE - DO NOT EDIT! *) (********************************************************) (* Generated by: ocaml-protoc-plugin *) (* https://github.com/andersfugmann/ocaml-protoc-plugin *) (********************************************************) (* Source: google/protobuf/duration.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 rec Google : sig module rec Protobuf : sig module rec Duration : sig val name': unit -> string type t = { seconds: int; nanos: int } val make: ?seconds:int -> ?nanos:int -> unit -> t val merge: t -> t -> t val to_proto': Runtime'.Writer.t -> t -> Runtime'.Writer.t val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t end end end = struct module rec Protobuf : sig module rec Duration : sig val name': unit -> string type t = { seconds: int; nanos: int } val make: ?seconds:int -> ?nanos:int -> unit -> t val merge: t -> t -> t val to_proto': Runtime'.Writer.t -> t -> Runtime'.Writer.t val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t end end = struct module rec Duration : sig val name': unit -> string type t = { seconds: int; nanos: int } val make: ?seconds:int -> ?nanos:int -> unit -> t val merge: t -> t -> t val to_proto': Runtime'.Writer.t -> t -> Runtime'.Writer.t val to_proto: t -> Runtime'.Writer.t val from_proto: Runtime'.Reader.t -> (t, [> Runtime'.Result.error]) result val from_proto_exn: Runtime'.Reader.t -> t end = struct let name' () = "duration.google.protobuf.Duration" type t = { seconds: int; nanos: int } let make ?(seconds = 0) ?(nanos = 0) () = { seconds; nanos } let merge = (fun t1 t2 -> { seconds = (Runtime'.Merge.merge Runtime'.Deserialize.C.( basic (1, int64_int, (0)) ) t1.seconds t2.seconds); nanos = (Runtime'.Merge.merge Runtime'.Deserialize.C.( basic (2, int32_int, (0)) ) t1.nanos t2.nanos); }) let to_proto' = let spec = Runtime'.Serialize.C.( basic (1, int64_int, (0)) ^:: basic (2, int32_int, (0)) ^:: nil ) in let serialize = Runtime'.Serialize.serialize spec in fun writer { seconds; nanos } -> serialize writer seconds nanos let to_proto t = to_proto' (Runtime'.Writer.init ()) t let from_proto_exn = let constructor = fun seconds nanos -> { seconds; nanos } in let spec = Runtime'.Deserialize.C.( basic (1, int64_int, (0)) ^:: basic (2, int32_int, (0)) ^:: nil ) in Runtime'.Deserialize.deserialize spec constructor let from_proto writer = Runtime'.Result.catch (fun () -> from_proto_exn writer) end end end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>