sig
exception Channel_closed of string
type 'mode channel
type input
type output
type 'a mode =
Input : Uwt_io.input Uwt_io.mode
| Output : Uwt_io.output Uwt_io.mode
val input : Uwt_io.input Uwt_io.mode
val output : Uwt_io.output Uwt_io.mode
type input_channel = Uwt_io.input Uwt_io.channel
type output_channel = Uwt_io.output Uwt_io.channel
val mode : 'a Uwt_io.channel -> 'a Uwt_io.mode
val stdin : Uwt_io.input_channel
val stdout : Uwt_io.output_channel
val stderr : Uwt_io.output_channel
val zero : Uwt_io.input_channel
val null : Uwt_io.output_channel
val pipe :
?cloexec:bool ->
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
unit -> Uwt_io.input_channel * Uwt_io.output_channel
val make :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
?seek:(int64 -> Unix.seek_command -> int64 Lwt.t) ->
mode:'mode Uwt_io.mode ->
(Uwt_bytes.t -> int -> int -> int Lwt.t) -> 'mode Uwt_io.channel
val of_bytes :
mode:'mode Uwt_io.mode -> Uwt_bytes.t -> 'mode Uwt_io.channel
val of_file :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m Uwt_io.mode -> Uwt.file -> 'm Uwt_io.channel
val of_stream :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m Uwt_io.mode -> Uwt.Stream.t -> 'm Uwt_io.channel
val of_pipe :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m Uwt_io.mode -> Uwt.Pipe.t -> 'm Uwt_io.channel
val of_tcp :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m Uwt_io.mode -> Uwt.Tcp.t -> 'm Uwt_io.channel
val close : 'a Uwt_io.channel -> unit Lwt.t
val abort : 'a Uwt_io.channel -> unit Lwt.t
val atomic :
('a Uwt_io.channel -> 'b Lwt.t) -> 'a Uwt_io.channel -> 'b Lwt.t
val file_length : string -> int64 Lwt.t
val buffered : 'a Uwt_io.channel -> int
val flush : Uwt_io.output_channel -> unit Lwt.t
val flush_all : unit -> unit Lwt.t
val buffer_size : 'a Uwt_io.channel -> int
val resize_buffer : 'a Uwt_io.channel -> int -> unit Lwt.t
val is_busy : 'a Uwt_io.channel -> bool
val position : 'a Uwt_io.channel -> int64
val set_position : 'a Uwt_io.channel -> int64 -> unit Lwt.t
val length : 'a Uwt_io.channel -> int64 Lwt.t
val read_char : Uwt_io.input_channel -> char Lwt.t
val read_char_opt : Uwt_io.input_channel -> char option Lwt.t
val read_chars : Uwt_io.input_channel -> char Lwt_stream.t
val read_line : Uwt_io.input_channel -> string Lwt.t
val read_line_opt : Uwt_io.input_channel -> string option Lwt.t
val read_lines : Uwt_io.input_channel -> string Lwt_stream.t
val read : ?count:int -> Uwt_io.input_channel -> string Lwt.t
val read_into : Uwt_io.input_channel -> Bytes.t -> int -> int -> int Lwt.t
val read_into_exactly :
Uwt_io.input_channel -> Bytes.t -> int -> int -> unit Lwt.t
val read_value : Uwt_io.input_channel -> 'a Lwt.t
val write_char : Uwt_io.output_channel -> char -> unit Lwt.t
val write_chars : Uwt_io.output_channel -> char Lwt_stream.t -> unit Lwt.t
val write : Uwt_io.output_channel -> string -> unit Lwt.t
val write_line : Uwt_io.output_channel -> string -> unit Lwt.t
val write_lines :
Uwt_io.output_channel -> string Lwt_stream.t -> unit Lwt.t
val write_from :
Uwt_io.output_channel -> Bytes.t -> int -> int -> int Lwt.t
val write_from_string :
Uwt_io.output_channel -> string -> int -> int -> int Lwt.t
val write_from_exactly :
Uwt_io.output_channel -> Bytes.t -> int -> int -> unit Lwt.t
val write_from_string_exactly :
Uwt_io.output_channel -> string -> int -> int -> unit Lwt.t
val write_value :
Uwt_io.output_channel ->
?flags:Marshal.extern_flags list -> 'a -> unit Lwt.t
val fprint : Uwt_io.output_channel -> string -> unit Lwt.t
val fprintl : Uwt_io.output_channel -> string -> unit Lwt.t
val fprintf :
Uwt_io.output_channel ->
('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val fprintlf :
Uwt_io.output_channel ->
('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val print : string -> unit Lwt.t
val printl : string -> unit Lwt.t
val printf : ('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val printlf : ('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val eprint : string -> unit Lwt.t
val eprintl : string -> unit Lwt.t
val eprintf : ('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val eprintlf : ('a, unit, string, unit Lwt.t) Pervasives.format4 -> 'a
val hexdump_stream :
Uwt_io.output_channel -> char Lwt_stream.t -> unit Lwt.t
val hexdump : Uwt_io.output_channel -> string -> unit Lwt.t
type file_name = string
val open_file :
?buffer:Uwt_bytes.t ->
?flags:Uwt.Fs.uv_open_flag list ->
?perm:Unix.file_perm ->
mode:'a Uwt_io.mode -> Uwt_io.file_name -> 'a Uwt_io.channel Lwt.t
val with_file :
?buffer:Uwt_bytes.t ->
?flags:Uwt.Fs.uv_open_flag list ->
?perm:Unix.file_perm ->
mode:'a Uwt_io.mode ->
Uwt_io.file_name -> ('a Uwt_io.channel -> 'b Lwt.t) -> 'b Lwt.t
val open_temp_file :
?buffer:Uwt_bytes.t ->
?flags:Uwt.Fs.uv_open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string -> unit -> (string * Uwt_io.output_channel) Lwt.t
val with_temp_file :
?buffer:Uwt_bytes.t ->
?flags:Uwt.Fs.uv_open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string ->
(string * Uwt_io.output_channel -> 'b Lwt.t) -> 'b Lwt.t
val open_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr -> (Uwt_io.input_channel * Uwt_io.output_channel) Lwt.t
val with_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr ->
(Uwt_io.input_channel * Uwt_io.output_channel -> 'a Lwt.t) -> 'a Lwt.t
type server
val establish_server_with_client_address :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(Unix.sockaddr ->
Uwt_io.input_channel * Uwt_io.output_channel -> unit Lwt.t) ->
Uwt_io.server Lwt.t
val establish_server :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(Uwt_io.input_channel * Uwt_io.output_channel -> unit Lwt.t) ->
Uwt_io.server Lwt.t
val shutdown_server : Uwt_io.server -> unit Lwt.t
val lines_of_file : Uwt_io.file_name -> string Lwt_stream.t
val lines_to_file : Uwt_io.file_name -> string Lwt_stream.t -> unit Lwt.t
val chars_of_file : Uwt_io.file_name -> char Lwt_stream.t
val chars_to_file : Uwt_io.file_name -> char Lwt_stream.t -> unit Lwt.t
module type NumberIO =
sig
val read_int : Uwt_io.input_channel -> int Lwt.t
val read_int16 : Uwt_io.input_channel -> int Lwt.t
val read_int32 : Uwt_io.input_channel -> int32 Lwt.t
val read_int64 : Uwt_io.input_channel -> int64 Lwt.t
val read_float32 : Uwt_io.input_channel -> float Lwt.t
val read_float64 : Uwt_io.input_channel -> float Lwt.t
val write_int : Uwt_io.output_channel -> int -> unit Lwt.t
val write_int16 : Uwt_io.output_channel -> int -> unit Lwt.t
val write_int32 : Uwt_io.output_channel -> int32 -> unit Lwt.t
val write_int64 : Uwt_io.output_channel -> int64 -> unit Lwt.t
val write_float32 : Uwt_io.output_channel -> float -> unit Lwt.t
val write_float64 : Uwt_io.output_channel -> float -> unit Lwt.t
end
module LE : NumberIO
module BE : NumberIO
val read_int : input_channel -> int Lwt.t
val read_int16 : input_channel -> int Lwt.t
val read_int32 : input_channel -> int32 Lwt.t
val read_int64 : input_channel -> int64 Lwt.t
val read_float32 : input_channel -> float Lwt.t
val read_float64 : input_channel -> float Lwt.t
val write_int : output_channel -> int -> unit Lwt.t
val write_int16 : output_channel -> int -> unit Lwt.t
val write_int32 : output_channel -> int32 -> unit Lwt.t
val write_int64 : output_channel -> int64 -> unit Lwt.t
val write_float32 : output_channel -> float -> unit Lwt.t
val write_float64 : output_channel -> float -> unit Lwt.t
type byte_order = Little_endian | Big_endian
val system_byte_order : Uwt_io.byte_order
val block :
'a Uwt_io.channel -> int -> (Uwt_bytes.t -> int -> 'b Lwt.t) -> 'b Lwt.t
type direct_access = {
da_buffer : Uwt_bytes.t;
mutable da_ptr : int;
mutable da_max : int;
da_perform : unit -> int Lwt.t;
}
val direct_access :
'a Uwt_io.channel -> (Uwt_io.direct_access -> 'b Lwt.t) -> 'b Lwt.t
val default_buffer_size : unit -> int
val set_default_buffer_size : int -> unit
end