Module Reader0.Internal

module State : sig ... end
module Open_flags = Unix.Open_flags
type open_flags = [
| `Already_closed
| `Ok of Open_flags.t
| `Error of exn
]
val sexp_of_open_flags : open_flags -> Ppx_sexp_conv_lib.Sexp.t
type t = {
fd : Async_unix.Fd.t;
id : Id.t;
mutable buf : Core.Bigstring.t;
mutable close_may_destroy_buf : [ `Yes | `Not_now | `Not_ever ];
mutable pos : int;
mutable available : int;
mutable state : State.t;
close_finished : unit Async_unix__.Import.Ivar.t;
mutable last_read_time : Core.Time.t;
open_flags : open_flags Async_unix__.Import.Deferred.t;
}
val open_flags : t -> open_flags Async_unix__.Import.Deferred.t
val last_read_time : t -> Core.Time.t
val set_last_read_time : t -> Core.Time.t -> unit
val close_finished : t -> unit Async_unix__.Import.Ivar.t
val state : t -> State.t
val set_state : t -> State.t -> 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.Bigstring.t
val set_buf : t -> Core.Bigstring.t -> unit
val id : t -> Id.t
val fd : t -> Async_unix.Fd.t
module Fields : sig ... end
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
type t_internals = t
val sexp_of_t_internals : t -> Ppx_sexp_conv_lib.Sexp.t
val io_stats : Async_unix.Io_stats.t
val invariant : t -> unit
val create : ?⁠buf_len:Core_kernel__Int.t -> Async_unix.Fd.t -> t
val of_in_channel : Core.In_channel.t -> Async_unix.Fd.Kind.t -> t
val open_file : ?⁠buf_len:Core_kernel__Int.t -> string -> t Async_kernel__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.Bigstring.t
val destroy : t -> unit
val close : t -> unit Async_kernel__.Deferred0.t
val with_close : t -> f:(unit -> 'a Async_unix__.Import.Monitor.Deferred.t) -> 'a Async_unix__.Import.Monitor.Deferred.t
val with_reader_exclusive : t -> (unit -> 'a Async_unix__.Import.Monitor.Deferred.t) -> 'a Async_kernel__Deferred.t
val with_file : ?⁠buf_len:Core_kernel__Int.t -> ?⁠exclusive:bool -> string -> f:(t -> 'a Async_unix__.Import.Monitor.Deferred.t) -> 'a Async_kernel__Deferred.t
val get_data : t -> [ `Eof | `Ok ] Async_unix__.Import.Deferred.t
val ensure_buf_len : t -> at_least:Core_kernel__Int.t -> unit
val get_data_until : t -> available_at_least:Core_kernel__Int.t -> [> `Eof of int | `Ok ] Async_kernel__Deferred.t
val with_nonempty_buffer : t -> ([ `Eof | `Ok ] -> 'a) -> 'a Async_unix__.Import.Deferred.t
val with_nonempty_buffer' : ?⁠force_refill:bool -> t -> ([ `Eof | `Ok ] -> unit) -> unit
val consume : t -> Core_kernel__Int.t -> 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 -> Ppx_sexp_conv_lib.Sexp.t) -> 'a handle_chunk_result -> Ppx_sexp_conv_lib.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 -> Ppx_sexp_conv_lib.Sexp.t) -> 'a read_one_chunk_at_a_time_result -> Ppx_sexp_conv_lib.Sexp.t
type consumed = [
| `Consumed of int * [ `Need of int | `Need_unknown ]
]
val sexp_of_consumed : consumed -> Ppx_sexp_conv_lib.Sexp.t
val read_one_chunk_at_a_time : t -> handle_chunk:(Core.Bigstring.t -> pos:int -> len:int -> [< `Consumed of Core_kernel__Int.t * [ `Need of Core_kernel__Int.t | `Need_unknown ] | `Continue | `Stop of 'a | `Stop_consumed of 'a * Core_kernel__Int.t ] Async_unix__.Import.Deferred.t) -> [> `Eof | `Eof_with_unconsumed_data of Base.string | `Stopped of 'a ] Async_unix__.Import.Deferred.t
type 'a handle_iobuf_result = [
| `Stop of 'a
| `Continue
]
val sexp_of_handle_iobuf_result : a. ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a handle_iobuf_result -> Ppx_sexp_conv_lib.Sexp.t
val read_one_iobuf_at_a_time : t -> handle_chunk:(([< Core_kernel.read_write ]'a) Iobuf.t -> [< `Continue | `Stop of 'b ] Async_kernel__Deferred.t) -> [> `Eof | `Eof_with_unconsumed_data of Base.string | `Stopped of 'b ] Async_unix__.Import.Deferred.t
module Read : functor (S : Core.Substring_intf.S) -> functor (Name : sig ... end) -> sig ... end
module Read_substring : sig ... end
val read_substring_available : t -> Core.Substring.t -> Core.Int.t
val read_substring : t -> Core.Substring.t -> [> `Eof | `Ok of Core.Int.t ] Async_unix__.Import.Deferred.t
val really_read_substring : t -> Core.Substring.t -> [> `Eof of int | `Ok ] Async_unix__.Import.Deferred.t
module Read_bigsubstring : sig ... end
val read_bigsubstring : t -> Core.Bigsubstring.t -> [> `Eof | `Ok of Core.Int.t ] Async_unix__.Import.Deferred.t
val really_read_bigsubstring : t -> Core.Bigsubstring.t -> [> `Eof of int | `Ok ] Async_unix__.Import.Deferred.t
val really_read_bigstring : t -> Core.Bigsubstring.base -> [> `Eof of int | `Ok ] Async_unix__.Import.Deferred.t
val peek_available : t -> len:Core.Int.t -> Base.string
val peek : t -> len:Core_kernel__Int.t -> [> `Eof | `Ok of Base.string ] Async_kernel__Deferred.t
val read_available : t -> ?⁠pos:Core_kernel__.Import.int -> ?⁠len:Core_kernel__.Import.int -> Core.Substring.base -> Core.Int.t
val read : t -> ?⁠pos:Core_kernel__.Import.int -> ?⁠len:Core_kernel__.Import.int -> Core.Substring.base -> [> `Eof | `Ok of Core.Int.t ] Async_unix__.Import.Deferred.t
val really_read : t -> ?⁠pos:Core_kernel__.Import.int -> ?⁠len:Core_kernel__.Import.int -> Core.Substring.base -> [> `Eof of int | `Ok ] Async_unix__.Import.Deferred.t
val read_char : t -> [> `Eof | `Ok of Core_kernel__.Import.char ] Async_unix__.Import.Deferred.t
val first_char : t -> [< `Char of Base__Char.t | `Pred of Core_kernel__.Import.char -> bool ] -> Core_kernel__Int.t option Core.Or_error.t
val read_until_gen : t -> [< `Char of Base__Char.t | `Pred of Core_kernel__.Import.char -> bool ] -> keep_delim:bool -> max:Core_kernel__Int.t option -> (([> `Eof | `Eof_without_delim of Core_kernel__.Import.string | `Max_exceeded of Core_kernel__.Import.string | `Ok of Core_kernel__.Import.string ]Core_kernel.Error.t) Core._result -> unit) -> unit
val read_until : t -> [< `Char of Base__Char.t | `Pred of Core_kernel__.Import.char -> bool ] -> keep_delim:bool -> (([> `Eof | `Eof_without_delim of Core_kernel__.Import.string | `Ok of Core_kernel__.Import.string ]Core_kernel.Error.t) Core._result -> unit) -> unit
val line_delimiter_pred : [> `Char of char ]
val read_line_gen : t -> ([> `Eof | `Eof_without_delim of Core_kernel__.Import.string | `Ok of Core_kernel__.Import.string ] -> unit) -> unit
val read_line : t -> [> `Eof | `Ok of Core_kernel__.Import.string ] Async_unix__.Import.Deferred.t
val really_read_line : wait_time:Core.Time.Span.t -> t -> Core_kernel__.Import.string option Async_unix__.Import.Deferred.t
val space : Core.Bigstring.t
type 'sexp sexp_kind =
| Plain : Core.Sexp.t sexp_kind
| Annotated : Core.Sexp.Annotated.t sexp_kind
val gen_read_sexp : ?⁠parse_pos:Core.Sexp.Parse_pos.t -> t -> sexp_kind:'sexp sexp_kind -> (([> `Eof | `Ok of 'sexp * Core.Sexp.Parse_pos.t ]Core_kernel.Error.t) Core._result -> unit) -> unit
type 'a read = ?⁠parse_pos:Core.Sexp.Parse_pos.t -> 'a
val gen_read_sexps : ?⁠parse_pos:Core.Sexp.Parse_pos.t -> t -> sexp_kind:'a sexp_kind -> 'a Async_unix__.Import.Pipe.Reader.t
val read_sexps : ?⁠parse_pos:Core.Sexp.Parse_pos.t -> t -> Core.Sexp.t Async_unix__.Import.Pipe.Reader.t
val read_annotated_sexps : ?⁠parse_pos:Core.Sexp.Parse_pos.t -> t -> Core.Sexp.Annotated.t Async_unix__.Import.Pipe.Reader.t
module Peek_or_read : sig ... end
val peek_or_read_bin_prot : ?⁠max_len:Core_kernel__Int.t -> t -> peek_or_read:Peek_or_read.t -> 'a Bin_prot.Type_class.reader -> ([> `Eof | `Ok of 'a ] Core.Or_error.t -> unit) -> unit
val read_marshal_raw : t -> [> `Eof | `Ok of Core.Bytes.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 Async_unix__.Import.Pipe.Reader.t
val lines : t -> Core_kernel__.Import.string Async_unix__.Import.Pipe.Reader.t
val contents : t -> string Async_kernel__Deferred.t
val recv : t -> [> `Eof | `Ok of Core.Bytes.t ] Async_unix__.Import.Deferred.t
val transfer : t -> (Base.stringAsync_unix__.Import.Pipe.Writer.phantom) Async_unix__.Import.Pipe.t -> unit Async_unix__.Import.Deferred.t