package core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

I/O-vectors for scatter/gather-operations

type 'buf t = private {
  1. buf : 'buf;
    (*

    Buffer holding the I/O-vector

    *)
  2. pos : int;
    (*

    Position of I/O-vector in buffer

    *)
  3. len : int;
    (*

    Length of I/O-vector in buffer

    *)
}

Representation of I/O-vectors. NOTE: DO NOT CHANGE THE MEMORY LAYOUT OF THIS TYPE!!! All C-functions in our bindings that handle I/O-vectors depend on it.

include Ppx_sexp_conv_lib.Sexpable.S1 with type 'buf t := 'buf t
val t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
type 'buf kind

Kind of I/O-vector buffers

type bigstring = (char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t
val string_kind : string kind
val bigstring_kind : bigstring kind
val empty : 'buf kind -> 'buf t

empty the empty I/O-vector.

val of_string : ?pos:int -> ?len:int -> string -> string t

of_string ?pos ?len str

  • returns

    an I/O-vector designated by position pos and length len in string str.

  • raises Invalid_argument

    if designated substring out of bounds.

  • parameter pos

    default = 0

  • parameter len

    default = String.length str - pos

val of_bigstring : ?pos:int -> ?len:int -> bigstring -> bigstring t

of_bigstring ?pos ?len bstr

  • returns

    an I/O-vector designated by position pos and length len in bigstring bstr.

  • raises Invalid_argument

    if designated substring out of bounds.

  • parameter pos

    default = 0

  • parameter len

    default = String.length str - pos

val drop : 'buf t -> int -> 'buf t

drop iovec n drops n characters from iovec.

  • returns

    resulting I/O-vector.

  • raises Failure

    if n is greater than length of iovec.

val max_iovecs : int Core_kernel.Lazy.t
OCaml

Innovation. Community. Security.