module Read : Core.Std.Bin_prot.Read
module Type_class : Core.Std.Bin_prot.Type_class
module Unix : Unix_syscalls
module Id : Core.Std.Unique_id.Int63(sig .. end)
module Read_result : sig .. end
module Z : sig .. end
type 'a t = [ `Eof | `Ok of 'a ]
val __t_of_sexp__ : 'a. (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val t_of_sexp : 'a. (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val sexp_of_t : 'a. ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
val bin_size_t : ('a -> int) -> [> `Ok of 'a ] -> int
val bin_write_t : (Core.Std.Bin_prot.Common.buf ->
 pos:Core.Std.Bin_prot.Common.pos -> 'a -> Core.Std.Bin_prot.Common.pos) ->
Core.Std.Bin_prot.Common.buf ->
pos:Core.Std.Bin_prot.Common.pos ->
[< `Eof | `Ok of 'a ] -> Core.Std.Bin_prot.Common.pos
val bin_writer_t : 'a Core.Std.Bin_prot.Type_class.writer ->
[< `Eof | `Ok of 'a > `Ok ] Core.Std.Bin_prot.Type_class.writer
val __bin_read_t__ : ('a -> pos_ref:'b -> 'c) -> 'a -> pos_ref:'b -> int -> [> `Eof | `Ok of 'c ]
val bin_read_t : (Core.Std.Bin_prot.Common.buf ->
 pos_ref:Core.Std.Bin_prot.Common.pos_ref -> 'a) ->
Core.Std.Bin_prot.Common.buf ->
pos_ref:Core.Std.Bin_prot.Common.pos_ref -> [> `Eof | `Ok of 'a ]
val bin_reader_t : 'a Core.Std.Bin_prot.Type_class.reader ->
[> `Eof | `Ok of 'a ] Core.Std.Bin_prot.Type_class.reader
val bin_t : 'a Core.Std.Bin_prot.Type_class.t ->
[ `Eof | `Ok of 'a ] Core.Std.Bin_prot.Type_class.t
val bind : [< `Eof | `Ok of 'a ] -> ('a -> ([> `Eof ] as 'b)) -> 'b
val map : [< `Eof | `Ok of 'a ] -> f:('a -> 'b) -> [> `Eof | `Ok of 'b ]
val return : 'a -> [> `Ok of 'a ]
include Z
module Internal : sig .. end
module State : sig .. end
type t = [ `Closed | `In_use | `Not_in_use ]
val __t_of_sexp__ : Sexplib.Sexp.t -> t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
module Open_flags : Unix.Open_flags
type open_flags = (Open_flags.t, exn) Core.Std.Result.t
val sexp_of_open_flags : open_flags -> Sexplib.Sexp.t
type t = {
fd : Fd.t;
id : Id.t;
mutable buf : Core.Std.Bigstring.t Core.Std.sexp_opaque;
mutable close_may_destroy_buf : [ `Not_ever | `Not_now | `Yes ];
mutable pos : int;
mutable available : int;
mutable bin_prot_len_buf : Core.Std.Bigstring.t Core.Std.sexp_opaque;
mutable bin_prot_buf : Core.Std.Bigstring.t Core.Std.sexp_opaque;
mutable state : State.t;
close_finished : unit Import.Ivar.t;
mutable last_read_time : Core.Std.Time.t;
open_flags : open_flags Import.Deferred.t;
}
val sexp_of_t : t -> Sexplib.Sexp.t
val open_flags : t -> open_flags Import.Deferred.t
val last_read_time : t -> Core.Std.Time.t
val set_last_read_time : t -> Core.Std.Time.t -> unit
val close_finished : t -> unit Import.Ivar.t
val state : t -> State.t
val set_state : t -> State.t -> unit
val bin_prot_buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque
val set_bin_prot_buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> unit
val bin_prot_len_buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque
val set_bin_prot_len_buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> unit
val available : t -> int
val set_available : t -> int -> unit
val pos : t -> int
val set_pos : t -> int -> unit
val close_may_destroy_buf : t -> [ `Not_ever | `Not_now | `Yes ]
val set_close_may_destroy_buf : t -> [ `Not_ever | `Not_now | `Yes ] -> unit
val buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque
val set_buf : t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> unit
val id : t -> Id.t
val fd : t -> Fd.t
module Fields : sig .. end
val names : string list
val open_flags : ([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
Fieldslib.Field.t_with_perm
val last_read_time : ([< `Read | `Set_and_create ], t, Core.Std.Time.t)
Fieldslib.Field.t_with_perm
val close_finished : ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
Fieldslib.Field.t_with_perm
val state : ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm
val bin_prot_buf : ([< `Read | `Set_and_create ], t, Core.Std.Bigstring.t Core.Std.sexp_opaque)
Fieldslib.Field.t_with_perm
val bin_prot_len_buf : ([< `Read | `Set_and_create ], t, Core.Std.Bigstring.t Core.Std.sexp_opaque)
Fieldslib.Field.t_with_perm
val available : ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm
val pos : ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm
val close_may_destroy_buf : ([< `Read | `Set_and_create ], t, [ `Not_ever | `Not_now | `Yes ])
Fieldslib.Field.t_with_perm
val buf : ([< `Read | `Set_and_create ], t, Core.Std.Bigstring.t Core.Std.sexp_opaque)
Fieldslib.Field.t_with_perm
val id : ([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm
val fd : ([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm
val make_creator : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    'a -> ('b -> Fd.t) * 'c) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    'c -> ('b -> Id.t) * 'd) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm ->
     'd -> ('b -> Core.Std.Bigstring.t Core.Std.sexp_opaque) * 'e) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm ->
                       'e -> ('b -> [ `Not_ever | `Not_now | `Yes ]) * 'f) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     'f -> ('b -> int) * 'g) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           'g -> ('b -> int) * 'h) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm ->
                  'h ->
                  ('b -> Core.Std.Bigstring.t Core.Std.sexp_opaque) * 'i) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm ->
              'i -> ('b -> Core.Std.Bigstring.t Core.Std.sexp_opaque) * 'j) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'j -> ('b -> State.t) * 'k) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm ->
                'k -> ('b -> unit Import.Ivar.t) * 'l) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm ->
                'l -> ('b -> Core.Std.Time.t) * 'm) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm ->
            'm -> ('b -> open_flags Import.Deferred.t) * 'n) ->
'a -> ('b -> t) * 'n
val create : fd:Fd.t ->
id:Id.t ->
buf:Core.Std.Bigstring.t Core.Std.sexp_opaque ->
close_may_destroy_buf:[ `Not_ever | `Not_now | `Yes ] ->
pos:int ->
available:int ->
bin_prot_len_buf:Core.Std.Bigstring.t Core.Std.sexp_opaque ->
bin_prot_buf:Core.Std.Bigstring.t Core.Std.sexp_opaque ->
state:State.t ->
close_finished:unit Import.Ivar.t ->
last_read_time:Core.Std.Time.t ->
open_flags:open_flags Import.Deferred.t -> t
val map : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    Fd.t) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    Id.t) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> Core.Std.Bigstring.t Core.Std.sexp_opaque) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm ->
                       [ `Not_ever | `Not_now | `Yes ]) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     int) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           int) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm ->
                  Core.Std.Bigstring.t Core.Std.sexp_opaque) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm ->
              Core.Std.Bigstring.t Core.Std.sexp_opaque) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       State.t) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> unit Import.Ivar.t) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> Core.Std.Time.t) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> open_flags Import.Deferred.t) ->
t
val iter : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm -> 'a) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm -> 'b) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> 'c) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm -> 'd) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm -> 'e) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           'f) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm -> 'g) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm -> 'h) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'i) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'j) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> 'k) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> 'l) ->
'l
val fold : init:'a ->
fd:('a ->
    ([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm -> 'b) ->
id:('b ->
    ([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm -> 'c) ->
buf:('c ->
     ([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> 'd) ->
close_may_destroy_buf:('d ->
                       ([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm -> 'e) ->
pos:('e ->
     ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm -> 'f) ->
available:('f ->
           ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           'g) ->
bin_prot_len_buf:('g ->
                  ([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm -> 'h) ->
bin_prot_buf:('h ->
              ([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm -> 'i) ->
state:('i ->
       ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'j) ->
close_finished:('j ->
                ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'k) ->
last_read_time:('k ->
                ([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> 'l) ->
open_flags:('l ->
            ([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> 'm) ->
'm
val map_poly : ([< `Read | `Set_and_create ], t, 'a) Fieldslib.Field.user -> 'a list
val for_all : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    bool) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    bool) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> bool) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm -> bool) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     bool) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           bool) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm -> bool) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm -> bool) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       bool) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> bool) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> bool) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> bool) ->
bool
val exists : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    bool) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    bool) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> bool) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm -> bool) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     bool) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           bool) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm -> bool) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm -> bool) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       bool) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> bool) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> bool) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> bool) ->
bool
val to_list : fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm -> 'a) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm -> 'a) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm -> 'a) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm -> 'a) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm -> 'a) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           'a) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm -> 'a) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm -> 'a) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       'a) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> 'a) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> 'a) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm -> 'a) ->
'a list
module Direct : sig .. end
val iter : t ->
fd:(([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    t -> Fd.t -> 'a) ->
id:(([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    t -> Id.t -> 'b) ->
buf:(([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm ->
     t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'c) ->
close_may_destroy_buf:(([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm ->
                       t -> [ `Not_ever | `Not_now | `Yes ] -> 'd) ->
pos:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     t -> int -> 'e) ->
available:(([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           t -> int -> 'f) ->
bin_prot_len_buf:(([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm ->
                  t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'g) ->
bin_prot_buf:(([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm ->
              t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'h) ->
state:(([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       t -> State.t -> 'i) ->
close_finished:(([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> t -> unit Import.Ivar.t -> 'j) ->
last_read_time:(([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> t -> Core.Std.Time.t -> 'k) ->
open_flags:(([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm ->
            t -> open_flags Import.Deferred.t -> 'l) ->
'l
val fold : t ->
init:'a ->
fd:('a ->
    ([< `Read | `Set_and_create ], t, Fd.t) Fieldslib.Field.t_with_perm ->
    t -> Fd.t -> 'b) ->
id:('b ->
    ([< `Read | `Set_and_create ], t, Id.t) Fieldslib.Field.t_with_perm ->
    t -> Id.t -> 'c) ->
buf:('c ->
     ([< `Read | `Set_and_create ], t,
      Core.Std.Bigstring.t Core.Std.sexp_opaque)
     Fieldslib.Field.t_with_perm ->
     t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'd) ->
close_may_destroy_buf:('d ->
                       ([< `Read | `Set_and_create ], t,
                        [ `Not_ever | `Not_now | `Yes ])
                       Fieldslib.Field.t_with_perm ->
                       t -> [ `Not_ever | `Not_now | `Yes ] -> 'e) ->
pos:('e ->
     ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
     t -> int -> 'f) ->
available:('f ->
           ([< `Read | `Set_and_create ], t, int) Fieldslib.Field.t_with_perm ->
           t -> int -> 'g) ->
bin_prot_len_buf:('g ->
                  ([< `Read | `Set_and_create ], t,
                   Core.Std.Bigstring.t Core.Std.sexp_opaque)
                  Fieldslib.Field.t_with_perm ->
                  t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'h) ->
bin_prot_buf:('h ->
              ([< `Read | `Set_and_create ], t,
               Core.Std.Bigstring.t Core.Std.sexp_opaque)
              Fieldslib.Field.t_with_perm ->
              t -> Core.Std.Bigstring.t Core.Std.sexp_opaque -> 'i) ->
state:('i ->
       ([< `Read | `Set_and_create ], t, State.t) Fieldslib.Field.t_with_perm ->
       t -> State.t -> 'j) ->
close_finished:('j ->
                ([< `Read | `Set_and_create ], t, unit Import.Ivar.t)
                Fieldslib.Field.t_with_perm -> t -> unit Import.Ivar.t -> 'k) ->
last_read_time:('k ->
                ([< `Read | `Set_and_create ], t, Core.Std.Time.t)
                Fieldslib.Field.t_with_perm -> t -> Core.Std.Time.t -> 'l) ->
open_flags:('l ->
            ([< `Read | `Set_and_create ], t, open_flags Import.Deferred.t)
            Fieldslib.Field.t_with_perm ->
            t -> open_flags Import.Deferred.t -> 'm) ->
'm
val io_stats : Io_stats.t
val invariant : t -> unit
val create : ?buf_len:int -> Fd.t -> t
val of_in_channel : Core.Std.In_channel.t -> Fd.Kind.t -> t
val open_file : ?close_on_exec:bool -> ?buf_len:int -> string -> t Async_kernel.Deferred.t
val stdin : t lazy_t
val close_finished : t -> unit Import.Ivar.Deferred.t
val is_closed : t -> bool
val empty_buf : Core.Std.Bigstring.t
val destroy : t -> unit
val close : t -> unit Import.Ivar.Deferred.t
val with_close : t -> f:(unit -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val with_reader_exclusive : t -> (unit -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val with_file : ?buf_len:int ->
?exclusive:bool ->
string -> f:(t -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val get_data : t -> [ `Eof | `Ok ] Import.Deferred.t
val with_nonempty_buffer : t -> ([ `Eof | `Ok ] -> 'a) -> 'a Import.Deferred.t
val with_nonempty_buffer' : ?force_refill:bool -> t -> ([ `Eof | `Ok ] -> unit) -> unit
val consume : t -> int -> unit
type 'a read_one_chunk_at_a_time_result = [ `Eof | `Eof_with_unconsumed_data of string | `Stopped of 'a ]
val sexp_of_read_one_chunk_at_a_time_result : 'a.
  ('a -> Sexplib.Sexp.t) ->
  'a read_one_chunk_at_a_time_result -> Sexplib.Sexp.t
type consumed = [ `Consumed of int * [ `Need of int | `Need_unknown ] ]
val sexp_of_consumed : consumed -> Sexplib.Sexp.t
val read_one_chunk_at_a_time : t ->
handle_chunk:(Core.Std.Bigstring.t Core.Std.sexp_opaque ->
              pos:int ->
              len:int ->
              [< `Consumed of
                   int * [ `Need of Core.Std.Int.t | `Need_unknown ]
               | `Continue
               | `Stop of 'a
               | `Stop_consumed of 'a * int ]
              Import.Deferred.t) ->
[> `Eof | `Eof_with_unconsumed_data of string | `Stopped of 'a ]
Import.Deferred.t
module Read : 
functor (S : Core.Std.Substring_intf.S) ->
functor (Name : sig .. end) -> sig .. end
val read_available : t -> S.t -> [> `Ok of Core.Std.Int.t ]
val read : t -> S.t -> [> `Eof | `Ok of Core.Std.Int.t ] Import.Deferred.t
val really_read : t -> S.t -> [> `Eof of int | `Ok ] Import.Deferred.t
module Read_substring : Read(Core.Std.Substring)(sig .. end)
val read_substring : t ->
Core.Std.Substring.t -> [> `Eof | `Ok of Core.Std.Int.t ] Import.Deferred.t
val really_read_substring : t -> Core.Std.Substring.t -> [> `Eof of int | `Ok ] Import.Deferred.t
module Read_bigsubstring : Read(Core.Std.Bigsubstring)(sig .. end)
val read_bigsubstring : t ->
Core.Std.Bigsubstring.t ->
[> `Eof | `Ok of Core.Std.Int.t ] Import.Deferred.t
val really_read_bigsubstring : t -> Core.Std.Bigsubstring.t -> [> `Eof of int | `Ok ] Import.Deferred.t
val really_read_bigstring : t -> Core_kernel.Bigstring.t -> [> `Eof of int | `Ok ] Import.Deferred.t
val read : t ->
?pos:int ->
?len:int ->
Core.Std.Substring.base ->
[> `Eof | `Ok of Core.Std.Int.t ] Import.Deferred.t
val really_read : t ->
?pos:int ->
?len:int ->
Core.Std.Substring.base -> [> `Eof of int | `Ok ] Import.Deferred.t
val read_char : t -> [> `Eof | `Ok of char ] Import.Deferred.t
val first_char : t ->
[< `Char of char | `Pred of char -> bool ] -> int option Core.Std.Or_error.t
val read_until_gen : t ->
[< `Char of char | `Pred of char -> bool ] ->
keep_delim:bool ->
max:int option ->
(([> `Eof
   | `Eof_without_delim of string
   | `Max_exceeded of string
   | `Ok of string ],
  Core_kernel.Error.t)
 Core.Std._result -> unit) ->
unit
val read_until : t ->
[< `Char of char | `Pred of char -> bool ] ->
keep_delim:bool ->
(([> `Eof | `Eof_without_delim of string | `Ok of string ],
  Core_kernel.Error.t)
 Core.Std._result -> unit) ->
unit
val line_delimiter_pred : [> `Char of char ]
val read_line_gen : t ->
([> `Eof | `Eof_without_delim of string | `Ok of Core.Std.String.t ] -> unit) ->
unit
val read_line : t -> [> `Eof | `Ok of Core.Std.String.t ] Import.Deferred.t
val really_read_line : wait_time:Core.Std.Time.Span.t ->
t -> Core.Std.String.t option Import.Deferred.t
val space : Core.Std.Bigstring.t
val gen_read_sexp : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t ->
(?parse_pos:Core.Std.Sexp.Parse_pos.t ->
 ?len:int ->
 Core.Std.Bigstring.t ->
 (Core.Std.Bigstring.t, 'a) Core.Std.Sexp.parse_result) ->
(([> `Eof | `Ok of 'a * Core.Std.Sexp.Parse_pos.t ], Core_kernel.Error.t)
 Core.Std._result -> unit) ->
unit
type 'a read = ?parse_pos:Core.Std.Sexp.Parse_pos.t -> 'a
val gen_read_sexps : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t ->
(?parse_pos:Core.Std.Sexp.Parse_pos.t ->
 ?len:int ->
 Core.Std.Bigstring.t ->
 (Core.Std.Bigstring.t, 'a) Core.Std.Sexp.parse_result) ->
'a Import.Pipe.Reader.t
val read_sexps : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t -> Core.Std.Sexp.t Import.Pipe.Reader.t
val read_annotated_sexps : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t -> Core.Std.Sexp.Annotated.t Import.Pipe.Reader.t
val read_bin_prot : ?max_len:Core.Std.Int.t ->
t ->
'a Type_class.reader ->
([> `Eof | `Ok of 'a ] Core.Std.Or_error.t -> unit) -> unit
val read_marshal_raw : t -> [> `Eof | `Ok of Core.Std.String.t ] Async_kernel.Deferred.t
val read_marshal : t -> [> `Eof | `Ok of 'a ] Async_kernel.Deferred.t
val read_all : t ->
(t -> [< `Eof | `Ok of 'a ] Async_kernel.Deferred.t) ->
'a Import.Pipe.Reader.t
val lines : t -> Core.Std.String.t Import.Pipe.Reader.t
val contents : t -> string Async_kernel.Deferred.t
val recv : t -> [> `Eof | `Ok of Core.Std.String.t ] Import.Deferred.t
val transfer : t ->
(string, Import.Pipe.Writer.phantom) Import.Pipe.t -> unit Import.Deferred.t
include sig .. end with type __pa_nonrec_0 := Internal.t
type __pa_nonrec_0 = Internal.t
type t = __pa_nonrec_0
val sexp_of_t : t -> Sexplib.Sexp.t
include sig .. end with type __pa_nonrec_1 := 'a0 Internal.read_one_chunk_at_a_time_result
type 'a0 __pa_nonrec_1 = 'a0 Internal.read_one_chunk_at_a_time_result
type 'a read_one_chunk_at_a_time_result = 'a __pa_nonrec_1
val sexp_of_read_one_chunk_at_a_time_result : 'a.
  ('a -> Sexplib.Sexp.t) ->
  'a read_one_chunk_at_a_time_result -> Sexplib.Sexp.t
include sig .. end with type __pa_nonrec_2 := 'a0 Internal.read
type 'a0 __pa_nonrec_2 = 'a0 Internal.read
type 'a read = 'a __pa_nonrec_2
val close : Internal.t -> unit Import.Ivar.Deferred.t
val close_finished : Internal.t -> unit Import.Ivar.Deferred.t
val create : ?buf_len:int -> Fd.t -> Internal.t
val fd : Internal.t -> Fd.t
val id : Internal.t -> Id.t
val invariant : Internal.t -> unit
val io_stats : Io_stats.t
val is_closed : Internal.t -> bool
val last_read_time : Internal.t -> Core.Std.Time.t
val of_in_channel : Core.Std.In_channel.t -> Fd.Kind.t -> Internal.t
val open_file : ?close_on_exec:bool ->
?buf_len:int -> string -> Internal.t Async_kernel.Deferred.t
val stdin : Internal.t lazy_t
val with_close : Internal.t ->
f:(unit -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val with_file : ?buf_len:int ->
?exclusive:bool ->
string ->
f:(Internal.t -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val use : t -> unit
val finished_read : Internal.t -> unit
val do_read : t -> (unit -> 'a Async_kernel.Deferred.t) -> 'a Async_kernel.Deferred.t
val read : t ->
?pos:int ->
?len:int ->
Core.Std.Substring.base ->
[> `Eof | `Ok of Core.Std.Int.t ] Async_kernel.Deferred.t
val read_char : t -> [> `Eof | `Ok of char ] Async_kernel.Deferred.t
val read_substring : t ->
Core.Std.Substring.t ->
[> `Eof | `Ok of Core.Std.Int.t ] Async_kernel.Deferred.t
val read_bigsubstring : t ->
Core.Std.Bigsubstring.t ->
[> `Eof | `Ok of Core.Std.Int.t ] Async_kernel.Deferred.t
val read_one_chunk_at_a_time : t ->
handle_chunk:(Core.Std.Bigstring.t Core.Std.sexp_opaque ->
              pos:int ->
              len:int ->
              [< `Consumed of
                   int * [ `Need of Core.Std.Int.t | `Need_unknown ]
               | `Continue
               | `Stop of 'a
               | `Stop_consumed of 'a * int ]
              Import.Deferred.t) ->
[> `Eof | `Eof_with_unconsumed_data of string | `Stopped of 'a ]
Async_kernel.Deferred.t
val really_read : t ->
?pos:int ->
?len:int ->
Core.Std.Substring.base -> [> `Eof of int | `Ok ] Async_kernel.Deferred.t
val really_read_substring : t -> Core.Std.Substring.t -> [> `Eof of int | `Ok ] Async_kernel.Deferred.t
val really_read_bigsubstring : t ->
Core.Std.Bigsubstring.t -> [> `Eof of int | `Ok ] Async_kernel.Deferred.t
val read_line : t -> [> `Eof | `Ok of Core.Std.String.t ] Async_kernel.Deferred.t
val really_read_line : wait_time:Core.Std.Time.Span.t ->
t -> Core.Std.String.t option Async_kernel.Deferred.t
val do_read_k : t ->
(('a Core.Std.Or_error.t -> unit) -> unit) ->
('a -> 'b) -> 'b Import.Deferred.t
val read_until : t ->
[< `Char of char | `Pred of char -> bool ] ->
keep_delim:bool ->
[> `Eof | `Eof_without_delim of string | `Ok of string ] Import.Deferred.t
val read_until_max : t ->
[< `Char of char | `Pred of char -> bool ] ->
keep_delim:bool ->
max:int ->
[> `Eof
 | `Eof_without_delim of string
 | `Max_exceeded of string
 | `Ok of string ]
Import.Deferred.t
val read_sexp : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t -> [> `Eof | `Ok of Core.Std.Sexp.t ] Import.Deferred.t
val read_sexps : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t -> Core.Std.Sexp.t Import.Pipe.Reader.t
val read_annotated_sexps : ?parse_pos:Core.Std.Sexp.Parse_pos.t ->
t -> Core.Std.Sexp.Annotated.t Import.Pipe.Reader.t
val read_bin_prot : ?max_len:Core.Std.Int.t ->
t -> 'a Type_class.reader -> [> `Eof | `Ok of 'a ] Import.Deferred.t
val read_marshal_raw : t -> [> `Eof | `Ok of Core.Std.String.t ] Async_kernel.Deferred.t
val read_marshal : t -> [> `Eof | `Ok of 'a ] Async_kernel.Deferred.t
val recv : t -> [> `Eof | `Ok of Core.Std.String.t ] Async_kernel.Deferred.t
val read_all : Internal.t ->
(Internal.t -> [< `Eof | `Ok of 'a ] Async_kernel.Deferred.t) ->
'a Import.Pipe.Reader.t
val lines : t -> Core.Std.String.t Import.Pipe.Reader.t
val contents : t -> string Async_kernel.Deferred.t
val file_contents : string -> string Async_kernel.Deferred.t
val file_lines : string -> Core.Std.String.t list Async_kernel.Deferred.t
val transfer : t ->
(string, Import.Pipe.Writer.phantom) Import.Pipe.t -> unit Import.Deferred.t
val lseek : t -> int64 -> mode:[< `Cur | `End | `Set ] -> int64 Async_kernel.Deferred.t
val get_error : string ->
(Sexplib.Type.t -> 'a) ->
Core.Std.Sexp.Annotated.t -> (unit, Core.Std.Error.t) Core.Std._result
val gen_load_exn : ?exclusive:bool ->
string ->
(Core.Std.Sexp.t list -> 'a) ->
(Core.Std.Sexp.Annotated.t list -> Core.Std.Error.t) -> 'a Import.Deferred.t
type ('a, 'b) load = ?exclusive:bool ->
?expand_macros:bool ->
string -> (Core.Std.Sexp.t -> 'a) -> 'b Import.Deferred.t
module Macro_loader : Sexplib.Macro.Loader(sig .. end)
val get_load_result_exn : [< `Error of exn * 'a | `Result of 'b ] -> 'b
val load_sexp_exn : ?exclusive:bool ->
?expand_macros:bool ->
string -> (Sexplib.Sexp.t -> 'a) -> 'a Async_kernel.Deferred.t
val load_sexp : ?exclusive:bool ->
?expand_macros:bool ->
string -> (Sexplib.Sexp.t -> 'a) -> 'a Import.Deferred.Or_error.t
val load_sexps_exn : ?exclusive:bool ->
?expand_macros:bool ->
string ->
(Core.Std.Sexp.t -> 'a) -> 'a Core.Std.List.t Async_kernel.Deferred.t
val load_sexps : ?exclusive:bool ->
?expand_macros:bool ->
string ->
(Core.Std.Sexp.t -> 'a) -> 'a Core.Std.List.t Import.Deferred.Or_error.t
val pipe : t -> string Import.Pipe.Reader.t
val drain : t -> unit Async_kernel.Deferred.t