Up

Module Internal

Signature

module State : sig .. end
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
: [
| `Yes
| `Not_now
| `Not_ever
]
;
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 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 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 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 Import.Deferred.t
val stdin : t lazy_t
val close_finished : t -> unit Async_kernel.Deferred0.t
val is_closed : t -> bool
val empty_buf : Core.Std.Bigstring.t
val destroy : t -> unit
val close : t -> unit Async_kernel.Deferred0.t
val with_close : t -> f:(unit -> 'a Import.Monitor.Deferred.t) -> 'a Import.Monitor.Deferred.t
val with_reader_exclusive : t -> (unit -> 'a Import.Monitor.Deferred.t) -> 'a Import.Deferred.t
val with_file : ?buf_len:int -> ?exclusive:bool -> string -> f:(t -> 'a Import.Monitor.Deferred.t) -> 'a Import.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 handle_chunk_result = [
| `Stop of 'a
| `Stop_consumed of 'a * int
| `Continue
| `Consumed of int * [
| `Need of int
| `Need_unknown
]
]
val sexp_of_handle_chunk_result : 'a . ('a -> Sexplib.Sexp.t) -> 'a handle_chunk_result -> Sexplib.Sexp.t
type 'a read_one_chunk_at_a_time_result = [
| `Eof
| `Stopped of 'a
| `Eof_with_unconsumed_data of string
]
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
type 'a handle_iobuf_result = [
| `Stop of 'a
| `Continue
]
val sexp_of_handle_iobuf_result : 'a . ('a -> Sexplib.Sexp.t) -> 'a handle_iobuf_result -> Sexplib.Sexp.t
val read_one_iobuf_at_a_time : t -> handle_chunk:(([< ], Core.Std.Iobuf.seek) Core.Std.Iobuf.t -> [<
| `Continue
| `Stop of 'a
] Import.Deferred.t) -> [>
| `Eof
| `Eof_with_unconsumed_data of string
| `Stopped of 'a
] Import.Deferred.t
module Read (S : Core.Std.Substring_intf.S) (Name : sig .. end) : sig .. end
module Read_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 : 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
] -> unit) -> unit
val read_line : t -> [>
| `Eof
] Import.Deferred.t
val really_read_line : wait_time:Core.Std.Time.Span.t -> t -> Core.Std.String.t option Import.Deferred.t
type 'sexp sexp_kind =
val gen_read_sexp : ?parse_pos:Core.Std.Sexp.Parse_pos.t -> t -> sexp_kind:'a sexp_kind -> (([>
| `Eof
], 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 -> sexp_kind:'a sexp_kind -> 'a 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 Core.Std.Bin_prot.Type_class.reader -> ([>
| `Eof
| `Ok of 'a
] Core.Std.Or_error.t -> unit) -> unit
val read_marshal_raw : t -> [>
| `Eof
] Import.Deferred.t
val read_marshal : t -> [>
| `Eof
| `Ok of 'a
] Import.Deferred.t
val read_all : t -> (t -> [<
| `Eof
| `Ok of 'a
] Import.Deferred.t) -> 'a Import.Pipe.Reader.t
val contents : t -> string Import.Deferred.t
val recv : t -> [>
| `Eof
] Import.Deferred.t
val transfer : t -> (string, Import.Pipe.Writer.phantom) Import.Pipe.t -> unit Import.Deferred.t