package ocaml-protoc-plugin

  1. Overview
  2. Docs

Describes a message type.

module ExtensionRange : sig ... end
module ReservedRange : sig ... end

Range of reserved tag numbers. Reserved tag numbers may not be used by fields or extension ranges in the same message. Reserved ranges may not overlap.

type t = {
  1. name : string option;
  2. field : FieldDescriptorProto.t list;
  3. nested_type : t list;
  4. enum_type : EnumDescriptorProto.t list;
  5. extension_range : ExtensionRange.t list;
  6. extension : FieldDescriptorProto.t list;
  7. options : MessageOptions.t option;
  8. oneof_decl : OneofDescriptorProto.t list;
  9. reserved_range : ReservedRange.t list;
  10. reserved_name : string list;
    (*

    Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.

    *)
}
val make : ?name:string -> ?field:FieldDescriptorProto.t list -> ?nested_type:t list -> ?enum_type:EnumDescriptorProto.t list -> ?extension_range:ExtensionRange.t list -> ?extension:FieldDescriptorProto.t list -> ?options:MessageOptions.t -> ?oneof_decl:OneofDescriptorProto.t list -> ?reserved_range:ReservedRange.t list -> ?reserved_name:string list -> unit -> t

Helper function to generate a message using default values

Serialize the message to binary format

val from_proto : Ocaml_protoc_plugin.Reader.t -> (t, [> Ocaml_protoc_plugin.Result.error ]) Stdlib.result

Deserialize from binary format

Serialize to Json (compatible with Yojson.Basic.t)

val from_json : Ocaml_protoc_plugin.Json.t -> (t, [> Ocaml_protoc_plugin.Result.error ]) Stdlib.result

Deserialize from Json (compatible with Yojson.Basic.t)

val name : unit -> string

Fully qualified protobuf name of this message

OCaml

Innovation. Community. Security.