Body.Writerval write_char : t -> char -> unitwrite_char w char copies char into an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
val write_string : t -> ?off:int -> ?len:int -> string -> unitwrite_string w ?off ?len str copies str into an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
write_bigstring w ?off ?len bs copies bs into an internal buffer. If possible, this write will be combined with previous and/or subsequent writes before transmission.
schedule_bigstring w ?off ?len bs schedules bs to be transmitted at the next opportunity without performing a copy. bs should not be modified until a subsequent call to flush has successfully completed.
val flush_with_reason : t -> ([ `Written | `Closed ] -> unit) -> unitflush_with_reason t f makes all bytes in t available for writing to the awaiting output channel. Once those bytes have reached that output channel, f `Written will be called. If instead, the output channel is closed before all of those bytes are successfully written, f `Closed will 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 flush : t -> (unit -> unit) -> unitflush t f is identical to flush_with_reason t, except ignoring the result of the flush. In most situations, you should use flush_with_reason and properly handle a closed output channel.
val close : t -> unitclose t closes t, causing subsequent write calls to raise. If t is writable, this will cause any pending output to become available to the output channel.