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 ('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
module Window = Core__Iobuf.Windowmodule Limits = Core__Iobuf.Limitsmodule Hexdump = Core__Iobuf.Hexdumpmodule Debug = Core__Iobuf.Debugval create : len:int -> ('a, 'b) tval of_bigstring : ?pos:int -> ?len:int -> Core__.Import.Bigstring.t -> ([< Core__.Import.read_write ], 'a) tval of_string : string -> ('a, 'b) tval set_bounds_and_buffer : src:([> Core__.Import.write ] as a, 'b) t -> dst:('a, seek) t -> unitval set_bounds_and_buffer_sub : pos:int -> len:int -> src:([> Core__.Import.write ] as a, 'b) t -> dst:('a, seek) t -> unitval read_only : ([> Core__.Import.read ], 's) t -> (Core__.Import.read, 's) tval no_seek : ('r, 'a) t -> ('r, no_seek) tval capacity : ('a, 'b) t -> intval length : ('a, 'b) t -> intval is_empty : ('a, 'b) t -> boolval narrow : ('a, seek) t -> unitval narrow_lo : ('a, seek) t -> unitval narrow_hi : ('a, seek) t -> unit
module type Bound = sig ... endmodule Lo_bound = Core__Iobuf.Lo_boundmodule Hi_bound = Core__Iobuf.Hi_boundval advance : ('a, seek) t -> int -> unitval unsafe_advance : ('a, seek) t -> int -> unitval resize : ('a, seek) t -> len:int -> unitval unsafe_resize : ('a, seek) t -> len:int -> unitval rewind : ('a, seek) t -> unitval reset : ('a, seek) t -> unitval flip_lo : ('a, seek) t -> unitval bounded_flip_lo : ('a, seek) t -> Lo_bound.t -> unitval compact : (Core__.Import.read_write, seek) t -> unitval bounded_compact : (Core__.Import.read_write, seek) t -> Lo_bound.t -> Hi_bound.t -> unitval flip_hi : ('a, seek) t -> unitval bounded_flip_hi : ('a, seek) t -> Hi_bound.t -> unitval protect_window_and_bounds : ('rw, no_seek) t -> f:(('rw, seek) t -> 'a) -> 'aval protect_window_and_bounds_1 : ('rw, no_seek) t -> 'a -> f:(('rw, seek) t -> 'a -> 'b) -> 'bval to_string : ?len:int -> ([> Core__.Import.read ], 'a) t -> stringval to_string_hum : ?max_lines:int -> ('a, 'b) t -> stringval to_bytes : ('a, 'b) t -> Core__.Import.Bytes.tval of_bytes : Core__.Import.Bytes.t -> ('a, 'b) t
module Consume = Core__Iobuf.Consumemodule Fill = Core__Iobuf.Fillmodule Peek = Core__Iobuf.Peekmodule Poke = Core__Iobuf.Pokemodule Unsafe = Core__Iobuf.Unsafeval bin_prot_length_prefix_bytes : intval fill_bin_prot : ([> Core__.Import.write ], seek) t -> 'a Bin_prot.Type_class.writer -> 'a -> unit Core__.Import.Or_error.tval consume_bin_prot : ([> Core__.Import.read ], seek) t -> 'a Bin_prot.Type_class.reader -> 'a Core__.Import.Or_error.t
module Blit = Core__Iobuf.Blitmodule Blit_consume = Core__Iobuf.Blit_consumemodule Blit_fill = Core__Iobuf.Blit_filltype ok_or_eof= Core__Iobuf.ok_or_eof=|Ok|Eof
val compare_ok_or_eof : ok_or_eof -> ok_or_eof -> intval sexp_of_ok_or_eof : ok_or_eof -> Ppx_sexp_conv_lib.Sexp.tval input : ([> Core__.Import.write ], seek) t -> Core__.Import.In_channel.t -> ok_or_eofval read : ([> Core__.Import.write ], seek) t -> Iobuf_intf.Unix.File_descr.t -> ok_or_eofval read_assume_fd_is_nonblocking : ([> Core__.Import.write ], seek) t -> Iobuf_intf.Unix.File_descr.t -> Core__.Syscall_result.Unit.tval pread_assume_fd_is_nonblocking : ([> Core__.Import.write ], seek) t -> Iobuf_intf.Unix.File_descr.t -> offset:int -> unitval 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.tval 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.tval 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.tval output : ([> Core__.Import.read ], seek) t -> Core__.Import.Out_channel.t -> unitval write : ([> Core__.Import.read ], seek) t -> Iobuf_intf.Unix.File_descr.t -> unitval write_assume_fd_is_nonblocking : ([> Core__.Import.read ], seek) t -> Iobuf_intf.Unix.File_descr.t -> unitval pwrite_assume_fd_is_nonblocking : ([> Core__.Import.read ], seek) t -> Iobuf_intf.Unix.File_descr.t -> offset:int -> unit
module Expert = Core__Iobuf.Expertval check_invariant : bool Core__.Import.refval show_messages : bool Core__.Import.ref