Module Buffering.Make

Parameters

module Fn : S.FN

Signature

type 'a io = 'a Lwt.t
type buffer = Cstruct.t
type error = [
| `Unix of Unix.error
]
val pp_error : Stdlib.Format.formatter -> [< `Unix of Unix.error ] -> unit
type write_error = [
| Mirage_flow.write_error
| error
]
val pp_write_error : Stdlib.Format.formatter -> [< `Closed | `Unix of Unix.error ] -> unit
type flow = {
fd : RW.t;
read_buffers_max : int;
read_max : int;
mutable read_buffers : Cstruct.t list;
mutable read_buffers_len : int;
read_buffers_m : Mutex.t;
read_buffers_c : Condition.t;
read_histogram : Histogram.t;
mutable write_buffers : Cstruct.t list;
mutable write_buffers_len : int;
write_buffers_m : Mutex.t;
write_buffers_c : Condition.t;
write_buffers_max : int;
write_max : int;
mutable write_flushed : bool;
write_histogram : Histogram.t;
mutable closed : bool;
mutable shutdown_read : bool;
mutable read_thread_exit : bool;
mutable shutdown_write : bool;
mutable shutdown_write_complete : bool;
mutable write_error : bool;
}
val connect : ?message_size:int -> ?buffer_size:int -> RW.t -> flow
val detach : ( 'a -> 'b ) -> 'c -> 'd Lwt.t
val wait_write_flush : flow -> unit
val close : flow -> unit Lwt.t
val shutdown_read : 'a -> unit Lwt.t
val shutdown_write : flow -> unit Lwt.t
val wait_for_data_or_eof : flow -> int -> unit
val read : flow -> ( [> `Data of Cstruct.t | `Eof ], 'a ) Stdlib.result Lwt.t
val read_into : 'a -> 'b -> 'c
val wait_for_space : flow -> int -> unit
val writev : flow -> Cstruct.t list -> ( unit, [> `Closed ] ) Stdlib.result Lwt.t
val write : flow -> Cstruct.t -> ( unit, [> `Closed ] ) Stdlib.result Lwt.t