package octez-internal-libs

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

An ordered set of disjoint (offset, length) ranges.

val make : unit -> t

make () returns a new empty set of ranges.

val add : off:Optint.Int63.t -> len:int -> t -> unit

add ~off ~len t inserts the range (off, len) into t. When add is called multiple times sequentially, it is optimized for strictly decreasing offsets arguments.

val iter : (off:Optint.Int63.t -> len:Optint.Int63.t -> unit) -> t -> unit

iter fn t calls fn ~off ~len on every disjoint range (off, len) in the set t. The function fn ~off ~len is called with strictly increasing offsets. If two or more consecutive ranges (off,len) and (off+len,len') were added to the set t, a single call to fn will be performed on the englobing interval (off,len+len').

val count : t -> int

count t returns the number of adds performed on t.

OCaml

Innovation. Community. Security.