package ocaml-protoc-plugin

  1. Overview
  2. Docs

Module Protobuf.ReaderSource

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

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

Return an error if there is not enough data in input

Sourceval has_more : t -> bool

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

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

Innovation. Community. Security.