package ocaml-protoc

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ocaml_protoc_compiler_lib.Pb_codegen_ocaml_typeSource

OCaml type representation

Sourcetype payload_kind =
  1. | Pk_varint of bool
    (*

    zigzag

    *)
  2. | Pk_bits32
  3. | Pk_bits64
  4. | Pk_bytes
Sourcetype user_defined_type = {
  1. udt_module_prefix : string option;
  2. udt_type_name : string;
  3. udt_type : [ `Message | `Enum ];
}
Sourcetype basic_type =
  1. | Bt_string
  2. | Bt_float
  3. | Bt_int
  4. | Bt_int32
  5. | Bt_uint32
  6. | Bt_int64
  7. | Bt_uint64
  8. | Bt_bytes
  9. | Bt_bool
Sourcetype wrapper_type = {
  1. wt_type : basic_type;
  2. wt_pk : payload_kind;
}
Sourcetype field_type =
  1. | Ft_unit
  2. | Ft_basic_type of basic_type
  3. | Ft_user_defined_type of user_defined_type
  4. | Ft_wrapper_type of wrapper_type
Sourcetype default_value = Pb_option.constant option
Sourcetype associative_type =
  1. | At_list
  2. | At_hashtable
Sourcetype repeated_type =
  1. | Rt_list
  2. | Rt_repeated_field
Sourcetype encoding_number = int
Sourcetype is_packed = bool
Sourceand variant_constructor = {
  1. vc_constructor : string;
  2. vc_field_type : variant_constructor_type;
  3. vc_encoding_number : encoding_number;
  4. vc_payload_kind : payload_kind;
}
Sourceand variant_constructor_type =
  1. | Vct_nullary
  2. | Vct_non_nullary_constructor of field_type
Sourceand variant = {
  1. v_name : string;
  2. v_constructors : variant_constructor list;
}
Sourceand record_field = {
  1. rf_label : string;
  2. rf_field_type : record_field_type;
  3. rf_mutable : bool;
}
Sourceand record = {
  1. r_name : string;
  2. r_fields : record_field list;
}
Sourceand const_variant_constructor = {
  1. cvc_name : string;
  2. cvc_binary_value : int;
  3. cvc_string_value : string;
}
Sourceand const_variant = {
  1. cv_name : string;
  2. cv_constructors : const_variant_constructor list;
}
Sourceand type_spec =
  1. | Record of record
  2. | Variant of variant
  3. | Const_variant of const_variant
Sourcetype type_ = {
  1. module_prefix : string;
    (*

    code generation leads to several file/module being generated for a given type_. module_prefix is the common prefix for all those generated module and it is based on the `.proto` filename.

    *)
  2. spec : type_spec;
  3. type_level_ppx_extension : string option;
}