package protocell
A Protobuf plugin for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
protocell-1.0.0.tbz
sha256=8296a7b386ad3ceb5e815374e8e4aa608d618869988b6f89b354c46225582fa8
sha512=7e3c758ac59b3a52aa523e1939103e8b4ad6adf8801df0a4bb1f947650e6f626c83ae7c55f1d114bbb652114fd46e88a7ed4835079ba70eaeb137220aefc3189
doc/src/protocell.google/google_protobuf_any_pc.ml.html
Source file google_protobuf_any_pc.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
[@@@ocaml.warning "-39"] let (>>=) = Runtime.Result.(>>=) let (>>|) = Runtime.Result.(>>|) module Field' = Runtime.Field_value module Bin' = Runtime.Binary_format module Text' = Runtime.Text_format module rec Any : sig type t = { type_url : string; value' : string; } [@@deriving eq, show] val to_binary : t -> (string, [> Bin'.serialization_error]) result val of_binary : string -> (t, [> Bin'.deserialization_error]) result val to_text : t -> (string, [> Text'.serialization_error]) result val of_text : string -> (t, [> Text'.deserialization_error]) result end = struct type t = { type_url : string; value' : string; } [@@deriving eq, show] let rec to_binary = fun { type_url; value' } -> let _o = Runtime.Byte_output.create () in Bin'.serialize_field 1 Field'.String_t type_url _o >>= fun () -> Bin'.serialize_field 2 Field'.Bytes_t value' _o >>= fun () -> Ok (Runtime.Byte_output.contents _o) let rec of_binary = fun input' -> Ok (Runtime.Byte_input.create input') >>= Bin'.deserialize_message >>= fun _m -> Bin'.decode_field 1 Field'.String_t _m >>= fun type_url -> Bin'.decode_field 2 Field'.Bytes_t _m >>= fun value' -> Ok { type_url; value' } let rec to_text = fun { type_url; value' } -> let _o = Runtime.Byte_output.create () in Text'.serialize_field "type_url" Field'.String_t type_url _o >>= fun () -> Text'.serialize_field "value" Field'.Bytes_t value' _o >>= fun () -> Ok (Runtime.Byte_output.contents _o) let rec of_text = fun input' -> Ok (Runtime.Byte_input.create input') >>= Text'.deserialize_message >>= fun _m -> Text'.decode_field "type_url" Field'.String_t _m >>= fun type_url -> Text'.decode_field "value" Field'.Bytes_t _m >>= fun value' -> Ok { type_url; value' } end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>