Module Bin_prot.Read

Reading values from the binary protocol using (mostly) OCaml.

type ('a : any) reader = Common.buf @ local -> (pos_ref:Common.pos_ref @ local -> 'a) @ local

Type of reader functions for the binary protocol. They take a buffer and a reference to a read position, and return the unmarshalled value. The next buffer position after reading in the value will be stored in the position reference.

type (('a : any), ('b : any)) reader1 = 'a reader -> 'b reader
type (('a : any), ('b : any), ('c : any)) reader2 = 'a reader -> ('b, 'c) reader1
type (('a : any), ('b : any), ('c : any), ('d : any)) reader3 = 'a reader -> ('b, 'c, 'd) reader2
type ('a : any) reader__local = Common.buf @ local -> (pos_ref:Common.pos_ref @ local -> 'a @ local) @ local

Type of reader functions for the binary protocol. They take a buffer and a reference to a read position, and return the unmarshalled value. The next buffer position after reading in the value will be stored in the position reference.

type (('a : any), ('b : any)) reader1__local = 'a reader__local -> 'b reader__local
type (('a : any), ('b : any), ('c : any)) reader2__local = 'a reader__local -> ('b, 'c) reader1__local
type (('a : any), ('b : any), ('c : any), ('d : any)) reader3__local = 'a reader__local -> ('b, 'c, 'd) reader2__local
type ('a : any) vtag_reader = Common.buf @ local -> (pos_ref:Common.pos_ref @ local -> (Base.int -> 'a) @ local) @ local

Type of reader functions for polymorphic variant readers, after reading their tag. Used for definitions such as __bin_read_t__. The int argument is a numerical representation of the variant tag, such as `a.

type (('a : any), ('b : any)) vtag_reader1 = 'a reader -> 'b vtag_reader
type (('a : any), ('b : any), ('c : any)) vtag_reader2 = 'a reader -> ('b, 'c) vtag_reader1
type (('a : any), ('b : any), ('c : any), ('d : any)) vtag_reader3 = 'a reader -> ('b, 'c, 'd) vtag_reader2
val bin_read_unit : Base.unit reader
val bin_read_bool : Base.bool reader
val bin_read_string : Base.string reader
val bin_read_bytes : Base.bytes reader
val bin_read_char : Base.char reader
val bin_read_int : Base.int reader
val bin_read_nat0 : Nat0.t reader
val bin_read_float : Base.float reader
val bin_read_int32 : Base.int32 reader
val bin_read_int64 : Base.int64 reader
val bin_read_nativeint : Base.nativeint reader
val bin_read_ref : 'a. 'a reader -> 'a Base.ref reader
val bin_read_option : 'a. ('a, 'a Base.option) reader1
val bin_read_or_null : ('a, 'a Base.or_null) reader1
val bin_read_pair : ('a, 'b, 'a * 'b) reader2
val bin_read_triple : ('a, 'b, 'c, 'a * 'b * 'c) reader3
val bin_read_list : 'a. ('a, 'a Base.list) reader1
val bin_read_array : 'a. 'a reader -> 'a Base.array reader
val bin_read_iarray : 'a. 'a reader -> 'a Base.iarray reader
val bin_read_float32_vec : Common.vec32 reader
val bin_read_float64_vec : Common.vec64 reader
val bin_read_vec : Common.vec reader
val bin_read_float32_mat : Common.mat32 reader
val bin_read_float64_mat : Common.mat64 reader
val bin_read_mat : Common.mat reader
val bin_read_bigstring : Common.buf reader
val bin_read_variant_int : Base.int reader
val bin_read_int_8bit : Base.int reader
val bin_read_int_16bit : Base.int reader
val bin_read_int_32bit : Base.int reader
val bin_read_int_64bit : Base.int reader
val bin_read_int32_bits : Base.int32 reader
val bin_read_int64_bits : Base.int64 reader
val bin_read_network16_int : Base.int reader
val bin_read_network32_int : Base.int reader
val bin_read_network32_int32 : Base.int32 reader
val bin_read_network64_int : Base.int reader
val bin_read_network64_int64 : Base.int64 reader
val bin_read_md5 : Md5_lib.t reader
val bin_read_list_with_max_len : max_len:Base.int -> ('a, 'a Base.list) reader1

Fail early if the list is larger than max_len.

val bin_read_lazy : ('a, 'a lazy_t) reader1 @@ portable
val bin_read_bigarray1 : kind:('a, 'k) Bigarray.kind -> layout:'layout Bigarray.layout -> ('a, 'k, 'layout) Bigarray.Array1.t reader @@ portable
val bin_read_bigarray2 : kind:('a, 'k) Bigarray.kind -> layout:'layout Bigarray.layout -> ('a, 'k, 'layout) Bigarray.Array2.t reader @@ portable
val bin_read_floatarray : floatarray reader @@ portable