package vchan

  1. Overview
  2. Docs
type offset =
  1. | First
  2. | Second

Valid offsets within the shared page

val sexp_of_offset : offset -> Sexplib0.Sexp.t
val offset_of_sexp : Sexplib0.Sexp.t -> offset
val to_offset : offset -> int

to_offset x converts x to bytes

type t =
  1. | Within_shared_page of offset
    (*

    within the shared page

    *)
  2. | External of int
    (*

    in separately granted pages

    *)

Location of a data ring

include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val to_length : t -> int

to_length t gives the maximum number of available bytes at t

val to_order : t -> int

to_order t gives the 'order' which is shared via the metadata page and used to uniquely identify the location

val of_order : int -> [ `Ok of t | `Error of string ]

of_order x parses the order

val of_lengths : int -> int -> t * t

of_lengths read_size write_size chooses distinct t1,t2 to accommodate buffers of size read_size and write_size

OCaml

Innovation. Community. Security.