Module Lwt_unix.IO_vectors
Contents
Instructions: Use this module in your project
In the IDE (CLion, Visual Studio Code, Xcode, etc.) you use for your DkSDK project:
Add the following to your project's
dependencies/CMakeLists.txt:DkSDKProject_DeclareAvailable(lwt CONSTRAINT "= " FINDLIBS lwt lwt.unix) DkSDKProject_MakeAvailable(lwt)Add the
Findlib::lwtlibrary to any desired targets insrc/*/CMakeLists.txt:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::lwt)Click your IDE's
Buildbutton
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install lwt.nullEdit your
dune-projectand add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (lwt (>= ))))Then run:
dune build *.opam # if this fails, run: dune buildEdit your
<package>.opamfile and add:depends: [ # ... existing dependencies ... "lwt" {>= ""} ]Then run:
opam install . --deps-only
FINALLY, add the lwt.unix library to any desired (library)and/or (executable) targets in your **/dune files:
(library
(name YourLibrary)
; ... existing library options ...
(libraries
; ... existing libraries ...
lwt.unix))
(executable
(name YourExecutable)
; ... existing executable options ...
(libraries
; ... existing libraries ...
lwt.unix))typet
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_bigarray`` = ``(char,Stdlib.Bigarray.int8_unsigned_elt,Stdlib.Bigarray.c_layout)``Stdlib.Bigarray.Array1.t
Type abbreviation equivalent to Lwt_bytes.t.
Do not use this type name directly; use
Lwt_bytes.t instead.
valcreate : ``unit->t
Creates an empty I/O vector sequence.
valappend_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.
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.
valdrop :t->``int->unit
drop vs n adjusts the I/O vector sequence vs so that it no longer
includes its first n bytes.
valis_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.
valbyte_count :t->int
byte_count vs is the total number of bytes in vs.
- since 4.2.0
valsystem_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.
