package mm

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

Create an extensible ringbuffer: the size of the ringbuffer is extended if write space is too small at some point.

Parameters

module B : Buffer

Signature

type buffer = B.t

A buffer of elements.

type t

A ringbuffer.

val create : int -> t

Create a ringbuffer of given size.

val read_space : t -> int

Size of data available for reading.

val write_space : t -> int

Size of space available for writing.

val read_advance : t -> int -> unit

Drop data.

val write_advance : t -> int -> unit

Advance the write pointer.

val read : t -> buffer -> int -> int -> unit

Read data.

val peek : t -> buffer -> int -> int -> unit

Same as read but does not advance the read pointer.

val write : t -> buffer -> int -> int -> unit

Write data.

val transmit : t -> (buffer -> int -> int -> int) -> int

Read all the data in the ringbuffer.

OCaml

Innovation. Community. Security.