package lwt

  1. Overview
  2. Docs
Promises and event-driven I/O

Install

Dune Dependency

Authors

Maintainers

Sources

5.4.1.tar.gz
md5=5a8d2a83ee9314781f137d147a4c62ae
sha512=b872b7abe546c431ba62fe466423d7ace8e487ebd85ea5e859f462eb4c0a6884b242d9efd4a557b6da3ae699b0b695e0a783f89a1d1147cba7d99c4ae9d2db17

doc/lwt.unix/Lwt_unix/IO_vectors/index.html

Module Lwt_unix.IO_vectorsSource

Sequences of buffer slices for writev.

Sourcetype t

Mutable sequences of I/O vectors. An I/O vector describes a slice of a bytes or Bigarray buffer. 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 abbreviation equivalent to Lwt_bytes.t. Do not use this type name directly; use Lwt_bytes.t instead.

Sourceval create : unit -> t

Creates an empty I/O vector sequence.

Sourceval append_bytes : t -> bytes -> int -> int -> unit

append_bytes vs buffer offset length appends a slice of the bytes buffer buffer beginning at offset and with length length to the I/O vector sequence vs.

Sourceval append_bigarray : t -> _bigarray -> int -> int -> unit

append_bigarray vs buffer offset length appends a slice of the Bigarray buffer buffer beginning at offset and with length length to the I/O vector sequence vs.

Sourceval drop : t -> int -> unit

drop vs n adjusts the I/O vector sequence vs so that it no longer includes its first n bytes.

Sourceval is_empty : t -> bool

is_empty vs is true if and only if vs has no I/O vectors, or all I/O vectors in vs have zero bytes.

Sourceval byte_count : t -> int

byte_count vs is the total number of bytes in vs.

  • since 4.2.0
Sourceval system_limit : int option

Some systems limit the number of I/O vectors that can be passed in a single call to their writev or readv system calls. On those systems, if the limit is n, this value is equal to Some n. On systems without such a limit, the value is equal to None.

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.

OCaml

Innovation. Community. Security.