Module Lwt_unix.IO_vectors
Sequences of buffer slices for writev.
type tMutable sequences of I/O vectors. An I/O vector describes a slice of a
bytesorBigarraybuffer. Each I/O vector is a triple containing a reference to the buffer, an offset into the buffer where the slice begins, and the length of the slice.
type _bigarray= (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.tType abbreviation equivalent to
Lwt_bytes.t. Do not use this type name directly; useLwt_bytes.tinstead.
val create : unit -> tCreates an empty I/O vector sequence.
val append_bytes : t -> bytes -> int -> int -> unitappend_bytes vs buffer offset lengthappends a slice of thebytesbufferbufferbeginning atoffsetand with lengthlengthto the I/O vector sequencevs.
val append_bigarray : t -> _bigarray -> int -> int -> unitappend_bigarray vs buffer offset lengthappends a slice of theBigarraybufferbufferbeginning atoffsetand with lengthlengthto the I/O vector sequencevs.
val drop : t -> int -> unitdrop vs nadjusts the I/O vector sequencevsso that it no longer includes its firstnbytes.
val is_empty : t -> boolis_empty vsistrueif and only ifvshas no I/O vectors, or all I/O vectors invshave zero bytes.
val byte_count : t -> intbyte_count vsis the total number of bytes invs.- since
- 4.2.0
val system_limit : int optionSome systems limit the number of I/O vectors that can be passed in a single call to their
writevorreadvsystem calls. On those systems, if the limit isn, this value is equal toSome n. On systems without such a limit, the value is equal toNone.Unless you need atomic I/O operations, you can ignore this limit. The Lwt binding automatically respects it internally. See
Lwt_unix.writev.A typical limit is 1024 vectors.