package protocell

  1. Overview
  2. Docs
type t
type sort
type id = Base.string
type serialization_error = Field_value.validation_error
type parse_error = [
  1. | `Unexpected_character of Base.char
  2. | `Invalid_number_string of Base.string
  3. | `Identifier_expected
  4. | `Nested_message_unfinished
  5. | Byte_input.error
]
type parsed_message
val sort_to_string : sort -> Base.string
val serialize_field : id -> 'v Field_value.typ -> 'v -> Byte_output.t -> (Base.unit, [> serialization_error ]) Base.Result.t
val serialize_optional_field : id -> 'v Field_value.typ -> 'v Base.option -> Byte_output.t -> (Base.unit, [> serialization_error ]) Base.Result.t
val serialize_repeated_field : id -> 'v Field_value.typ -> 'v Base.list -> Byte_output.t -> (Base.unit, [> serialization_error ]) Base.Result.t
val serialize_user_field : id -> ('v -> (Base.string, [> serialization_error ] as 'e) Base.Result.t) -> 'v Base.option -> Byte_output.t -> (Base.unit, 'e) Base.Result.t
val serialize_user_oneof_field : id -> ('v -> (Base.string, [> serialization_error ] as 'e) Base.Result.t) -> 'v -> Byte_output.t -> (Base.unit, 'e) Base.Result.t
val serialize_repeated_user_field : id -> ('v -> (Base.string, [> serialization_error ] as 'e) Base.Result.t) -> 'v Base.list -> Byte_output.t -> (Base.unit, 'e) Base.Result.t
val serialize_enum_field : id -> ('v -> Base.string) -> 'v -> Byte_output.t -> (Base.unit, [> serialization_error ]) Base.Result.t
val serialize_repeated_enum_field : id -> ('v -> Base.string) -> 'v Base.list -> Byte_output.t -> (Base.unit, [> serialization_error ]) Base.Result.t
val deserialize_message : Byte_input.t -> (parsed_message, [> parse_error ]) Base.Result.t
val decode_user_field : id -> (Base.string -> ('v, [> deserialization_error ] as 'e) Base.Result.t) -> parsed_message -> ('v Base.option, 'e) Base.Result.t
val decode_user_oneof_field : id -> (Base.string -> ('v, [> deserialization_error ] as 'e) Base.Result.t) -> parsed_message -> ('v, 'e) Base.Result.t
val decode_repeated_user_field : id -> (Base.string -> ('v, [> deserialization_error ] as 'e) Base.Result.t) -> parsed_message -> ('v Base.list, 'e) Base.Result.t
val decode_enum_field : id -> (Base.string -> 'v Base.option) -> (Base.unit -> 'v) -> parsed_message -> ('v, [> deserialization_error ]) Base.Result.t
val decode_repeated_enum_field : id -> (Base.string -> 'v Base.option) -> (Base.unit -> 'v) -> parsed_message -> ('v Base.list, [> deserialization_error ]) Base.Result.t
val decode_oneof_field : (id, parsed_message -> ('v, [> deserialization_error ] as 'e) Base.Result.t) Base.List.Assoc.t -> parsed_message -> ('v Base.option, 'e) Base.Result.t
OCaml

Innovation. Community. Security.