Module Iobuf_debug.Make

Make builds a module that is like Iobuf, except that the module also has some controls for whether the various Iobuf functions do invariant checking and/or show debug messages. Initially, the bool ref's are true.

The performance of the functions in the module resulting from Make can be much worse than that of a plain Iobuf, even with all the controls set to false.

Parameters

Signature

We use module type of struct include Iobuf end rather than module type of Iobuf so that the debugging functions work on normal Iobufs.

include module type of sig ... end
type nonrec seek = Iobuf_intf.seek
val sexp_of_seek : seek -> Ppx_sexp_conv_lib.Sexp.t
type nonrec no_seek = Iobuf_intf.no_seek
val sexp_of_no_seek : no_seek -> Ppx_sexp_conv_lib.Sexp.t
type t_repr = Core__Iobuf.t_repr
type ('data_perm_read_write, 'seek_permission) t = ('data_perm_read_write'seek_permission) Core__Iobuf.t
val invariant : 'a Base__.Invariant_intf.inv -> 'b Base__.Invariant_intf.inv -> ('a'b) t Base__.Invariant_intf.inv
val create : len:int -> ('a'b) t
val of_bigstring : ?⁠pos:int -> ?⁠len:int -> Core__.Import.Bigstring.t -> ([< Core__.Import.read_write ]'a) t
val of_string : string -> ('a'b) t
val sub_shared : ?⁠pos:int -> ?⁠len:int -> ('d'a) t -> ('d'b) t
val set_bounds_and_buffer : src:([> Core__.Import.write ] as 'a, 'b) t -> dst:('aseek) t -> unit
val set_bounds_and_buffer_sub : pos:int -> len:int -> src:([> Core__.Import.write ] as 'a, 'b) t -> dst:('aseek) t -> unit
val read_only : ([> Core__.Import.read ]'s) t -> (Core__.Import.read's) t
val no_seek : ('r'a) t -> ('rno_seek) t
val capacity : ('a'b) t -> int
val length : ('a'b) t -> int
val length_lo : ('a'b) t -> int
val length_hi : ('a'b) t -> int
val is_empty : ('a'b) t -> bool
val narrow : ('aseek) t -> unit
val narrow_lo : ('aseek) t -> unit
val narrow_hi : ('aseek) t -> unit
val memcmp : ('a'b) t -> ('c'd) t -> int
module type Bound = sig ... end
val advance : ('aseek) t -> int -> unit
val unsafe_advance : ('aseek) t -> int -> unit
val resize : ('aseek) t -> len:int -> unit
val unsafe_resize : ('aseek) t -> len:int -> unit
val rewind : ('aseek) t -> unit
val reset : ('aseek) t -> unit
val flip_lo : ('aseek) t -> unit
val bounded_flip_lo : ('aseek) t -> Lo_bound.t -> unit
val compact : (Core__.Import.read_writeseek) t -> unit
val bounded_compact : (Core__.Import.read_writeseek) t -> Lo_bound.t -> Hi_bound.t -> unit
val flip_hi : ('aseek) t -> unit
val bounded_flip_hi : ('aseek) t -> Hi_bound.t -> unit
val protect_window_and_bounds : ('rwno_seek) t -> f:(('rwseek) t -> 'a) -> 'a
val protect_window_and_bounds_1 : ('rwno_seek) t -> 'a -> f:(('rwseek) t -> 'a -> 'b) -> 'b
val to_string : ?⁠len:int -> ([> Core__.Import.read ]'a) t -> string
val to_string_hum : ?⁠max_lines:int -> ('a'b) t -> string
val to_bytes : ?⁠len:int -> ('a'b) t -> Core__.Import.Bytes.t
val of_bytes : Core__.Import.Bytes.t -> ('a'b) t
val bin_prot_length_prefix_bytes : int
val fill_bin_prot : ([> Core__.Import.write ]seek) t -> 'a Bin_prot.Type_class.writer -> 'a -> unit Core__.Import.Or_error.t
val consume_bin_prot : ([> Core__.Import.read ]seek) t -> 'a Bin_prot.Type_class.reader -> 'a Core__.Import.Or_error.t
type ok_or_eof = Core__Iobuf.ok_or_eof =
| Ok
| Eof
val compare_ok_or_eof : ok_or_eof -> ok_or_eof -> int
val sexp_of_ok_or_eof : ok_or_eof -> Ppx_sexp_conv_lib.Sexp.t
val input : ([> Core__.Import.write ]seek) t -> Core__.Import.In_channel.t -> ok_or_eof
val read : ([> Core__.Import.write ]seek) t -> Iobuf_intf.Unix.File_descr.t -> ok_or_eof
val read_assume_fd_is_nonblocking : ([> Core__.Import.write ]seek) t -> Iobuf_intf.Unix.File_descr.t -> Core__.Syscall_result.Unit.t
val pread_assume_fd_is_nonblocking : ([> Core__.Import.write ]seek) t -> Iobuf_intf.Unix.File_descr.t -> offset:int -> unit
val recvfrom_assume_fd_is_nonblocking : ([> Core__.Import.write ]seek) t -> Iobuf_intf.Unix.File_descr.t -> Iobuf_intf.Unix.sockaddr
val recvmmsg_assume_fd_is_nonblocking : (Iobuf_intf.Unix.File_descr.t -> Recvmmsg_context.t -> Iobuf_intf.Unix.Syscall_result.Int.t) Core__.Import.Or_error.t
val send_nonblocking_no_sigpipe : unit -> (([> Core__.Import.read ]seek) t -> Iobuf_intf.Unix.File_descr.t -> Iobuf_intf.Unix.Syscall_result.Unit.t) Core__.Import.Or_error.t
val sendto_nonblocking_no_sigpipe : unit -> (([> Core__.Import.read ]seek) t -> Iobuf_intf.Unix.File_descr.t -> Iobuf_intf.Unix.sockaddr -> Iobuf_intf.Unix.Syscall_result.Unit.t) Core__.Import.Or_error.t
val output : ([> Core__.Import.read ]seek) t -> Core__.Import.Out_channel.t -> unit
val write : ([> Core__.Import.read ]seek) t -> Iobuf_intf.Unix.File_descr.t -> unit
val write_assume_fd_is_nonblocking : ([> Core__.Import.read ]seek) t -> Iobuf_intf.Unix.File_descr.t -> unit
val pwrite_assume_fd_is_nonblocking : ([> Core__.Import.read ]seek) t -> Iobuf_intf.Unix.File_descr.t -> offset:int -> unit
val check_invariant : bool Core__.Import.ref
val show_messages : bool Core__.Import.ref