package ocaml-protoc-plugin

  1. Overview
  2. Docs

Some buffer to hold data, and to read and write data

type t = {
  1. mutable offset : int;
  2. end_offset : int;
  3. data : StdLabels.String.t;
}
type error = [
  1. | `Premature_end_of_input
  2. | `Unknown_field_type of int
]
val create : ?offset:int -> ?length:int -> StdLabels.String.t -> t
val size : t -> int
val validate_capacity : t -> int -> (unit, [> `Premature_end_of_input ]) result

Return an error if there is not enough data in input

val has_more : t -> bool

Test if there is more data in the buffer to be read

val read_byte : t -> (int, [> `Premature_end_of_input ]) result
val read_raw_varint : t -> (int64, [> `Premature_end_of_input ]) result
val read_varint : t -> (Protobuf__.Field.t, [> `Premature_end_of_input ]) result
val read_field_header : t -> (int * int) Result.t
val read_length_delimited : t -> (Protobuf__.Field.t, [> `Premature_end_of_input ]) result
val read_fixed32 : t -> (Protobuf__.Field.t, [> `Premature_end_of_input ]) result
val read_fixed64 : t -> (Protobuf__.Field.t, [> `Premature_end_of_input ]) result
val read_field : t -> (int * Protobuf__.Field.t) Result.t
OCaml

Innovation. Community. Security.