Module H2.Body
val schedule_read : [ `read ] t -> on_eof:(unit -> unit) -> on_read:(Bigstringaf.t -> off:int -> len:int -> unit) -> unitschedule_read t ~on_eof ~on_readwill setupon_readandon_eofas callbacks for when bytes are available intfor the application to consume, or when the input channel has been closed and no further bytes will be received by the application.Once either of these callbacks have been called, they become inactive. The application is responsible for scheduling subsequent reads, either within the
on_readcallback or by some other mechanism.
val write_char : [ `write ] t -> char -> unitwrite_char w charcopiescharinto an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
val write_string : [ `write ] t -> ?off:int -> ?len:int -> string -> unitwrite_string w ?off ?len strcopiesstrinto an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
val write_bigstring : [ `write ] t -> ?off:int -> ?len:int -> Bigstringaf.t -> unitwrite_bigstring w ?off ?len bscopiesbsinto an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
val schedule_bigstring : [ `write ] t -> ?off:int -> ?len:int -> Bigstringaf.t -> unitschedule_bigstring w ?off ?len bsschedulesbsto be transmitted at the next opportunity without performing a copy.bsshould not be modified until a subsequent call toflushhas successfully completed.
val flush : [ `write ] t -> (unit -> unit) -> unitflush t fmakes all bytes intavailable for writing to the awaiting output channel. Once those bytes have reached that output channel,fwill be called.The type of the output channel is runtime-dependent, as are guarantees about whether those packets have been queued for delivery or have actually been received by the intended recipient.
val close_reader : [ `read ] t -> unitclose_reader tclosest, indicating that any subsequent input received should be discarded.
val close_writer : [ `write ] t -> unitclose_writer tclosest, causing subsequent write calls to raise. Iftis writable, this will cause any pending output to become available to the output channel.
val is_closed : _ t -> boolis_closed tistrueifclosehas been called ontandfalseotherwise. A closedtmay still have pending output.