sig
  module Kind :
    sig
      type t =
        Fd.Kind.t =
          Char
        | Fifo
        | File
        | Socket of [ `Active | `Bound | `Passive | `Unconnected ]
      val infer_using_stat :
        Core.Std.Unix.File_descr.t -> t Import.Deferred.t
    end
  type t = Fd.t
  val info : t -> Core.Std.Info.t
  val to_string : t -> string
  val create : Kind.t -> Core.Std.Unix.File_descr.t -> Core.Std.Info.t -> t
  val kind : t -> Kind.t
  val supports_nonblock : t -> bool
  val clear_nonblock : t -> unit
  val close :
    ?should_close_file_descriptor:bool -> t -> unit Import.Deferred.t
  val close_finished : t -> unit Import.Deferred.t
  val is_closed : t -> bool
  val with_close : t -> f:(t -> 'Import.Deferred.t) -> 'Import.Deferred.t
  val is_open : t -> bool
  val stdin : unit -> t
  val stdout : unit -> t
  val stderr : unit -> t
  val with_file_descr :
    ?nonblocking:bool ->
    t ->
    (Core.Std.Unix.File_descr.t -> 'a) ->
    [ `Already_closed | `Error of exn | `Ok of 'a ]
  val with_file_descr_exn :
    ?nonblocking:bool -> t -> (Core.Std.Unix.File_descr.t -> 'a) -> 'a
  val with_file_descr_deferred :
    t ->
    (Core.Std.Unix.File_descr.t -> 'Import.Deferred.t) ->
    [ `Already_closed | `Error of exn | `Ok of 'a ] Import.Deferred.t
  val interruptible_ready_to :
    t ->
    [ `Read | `Write ] ->
    interrupt:unit Import.Deferred.t ->
    [ `Bad_fd | `Closed | `Interrupted | `Ready ] Import.Deferred.t
  val ready_to :
    t ->
    [ `Read | `Write ] -> [ `Bad_fd | `Closed | `Ready ] Import.Deferred.t
  val interruptible_every_ready_to :
    t ->
    [ `Read | `Write ] ->
    interrupt:unit Import.Deferred.t ->
    ('-> unit) ->
    '->
    [ `Bad_fd | `Closed | `Interrupted | `Unsupported ] Import.Deferred.t
  val every_ready_to :
    t ->
    [ `Read | `Write ] ->
    ('-> unit) ->
    '-> [ `Bad_fd | `Closed | `Unsupported ] Import.Deferred.t
  val syscall :
    ?nonblocking:bool ->
    t ->
    (Core.Std.Unix.File_descr.t -> 'a) ->
    [ `Already_closed | `Error of exn | `Ok of 'a ]
  val syscall_exn :
    ?nonblocking:bool -> t -> (Core.Std.Unix.File_descr.t -> 'a) -> 'a
  val syscall_in_thread :
    t ->
    name:string ->
    (Core.Std.Unix.File_descr.t -> 'a) ->
    [ `Already_closed | `Error of exn | `Ok of 'a ] Import.Deferred.t
  val syscall_in_thread_exn :
    t ->
    name:string -> (Core.Std.Unix.File_descr.t -> 'a) -> 'Import.Deferred.t
  val of_in_channel : Core.Std.In_channel.t -> Kind.t -> t
  val of_out_channel : Core.Std.Out_channel.t -> Kind.t -> t
  val of_in_channel_auto : Core.Std.In_channel.t -> t Import.Deferred.t
  val of_out_channel_auto : Core.Std.Out_channel.t -> t Import.Deferred.t
  val file_descr_exn : t -> Core.Std.Unix.File_descr.t
  val to_int_exn : t -> int
  val replace : t -> Kind.t -> Core.Std.Info.t -> unit
  val ready_fold :
    t ->
    init:'->
    ?stop:unit Import.Deferred.t ->
    f:('-> Core.Std.Unix.File_descr.t -> 'a) ->
    [ `Read | `Write ] -> 'Import.Deferred.t
  val sexp_of_t : t -> Sexplib.Sexp.t
end