package ocaml-protoc-plugin
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
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/result.ml.html
Source file result.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(** This module provides result type and functions for compatibility * with OCaml 4.06 *) type error = [ `Premature_end_of_input | `Unknown_field_type of int | `Wrong_field_type of string * Field.t | `Illegal_value of string * Field.t | `Unknown_enum_value of int | `Oneof_missing | `Required_field_missing ] type 'a t = ('a, error) result let ( >>| ) v f = match v with Ok x -> Ok (f x) | Error err -> Error err let ( >>= ) v f = match v with Ok x -> f x | Error err -> Error err (* Extra functions (from Base) *) let return x = Ok x let fail x = Error x let pp_error : Format.formatter -> error -> unit = fun fmt -> function | `Premature_end_of_input -> Format.pp_print_string fmt "`Premature_end_of_input" | `Unknown_field_type x -> (Format.fprintf fmt "`Unknown_field_type (@[<hov>"; (Format.fprintf fmt "%d") x; Format.fprintf fmt "@])") | `Wrong_field_type x -> (Format.fprintf fmt "`Wrong_field_type (@[<hov>"; ((fun (a0, a1) -> Format.fprintf fmt "(@["; ((Format.fprintf fmt "%S") a0; Format.fprintf fmt ",@ "; (Field.pp fmt) a1); Format.fprintf fmt "@])")) x; Format.fprintf fmt "@])") | `Illegal_value x -> (Format.fprintf fmt "`Illegal_value (@[<hov>"; ((fun (a0, a1) -> Format.fprintf fmt "(@["; ((Format.fprintf fmt "%S") a0; Format.fprintf fmt ",@ "; (Field.pp fmt) a1); Format.fprintf fmt "@])")) x; Format.fprintf fmt "@])") | `Unknown_enum_value x -> (Format.fprintf fmt "`Unknown_enum_value (@[<hov>"; (Format.fprintf fmt "%d") x; Format.fprintf fmt "@])") | `Oneof_missing -> Format.pp_print_string fmt "`Oneof_missing" | `Required_field_missing -> Format.pp_print_string fmt "`Required_field_missing" let show_error : error -> string = Format.asprintf "%a" pp_error
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>