package octez-internal-libs

  1. Overview
  2. Docs
A package that contains some libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/irmin_pack_unix/Irmin_pack_unix/Sparse_file/Make/index.html

Module Sparse_file.MakeSource

Parameters

module Io : Io.S

Signature

module Io = Io
Sourcemodule Errs : Io_errors.S with module Io = Io
Sourcetype t
type open_error := [
  1. | Io.open_error
  2. | `Corrupted_mapping_file of string
]
Sourceval open_ro : mapping_size:int -> mapping:string -> data:string -> (t, [> open_error ]) Stdlib.result

open_ro ~mapping_size ~mapping ~data returns a new read-only view of the sparse file, represented on disk by two files named mapping and data. The mapping file is expected to have size at least mapping_size (and the rest is ignored if the file is larger).

Sourceval close : t -> (unit, [> Io.close_error ]) Stdlib.result

Close the underlying files.

Sourceval read_exn : t -> off:Optint.Int63.t -> len:int -> bytes -> unit

read_exn t ~off ~len buffer writes into buffer the bytes from off to off+len.

Sourceval read_range_exn : t -> off:Optint.Int63.t -> min_len:int -> max_len:int -> bytes -> int

Same as read_exn, the amount read is max_len if possible or at least min_len if reading more would step over a hole in the sparse file.

Returns the actually read length.

Sourceval next_valid_offset : t -> off:Optint.Int63.t -> Optint.Int63.t option

next_valid_offset t ~off returns Some off' such that off' is the smallest readable offset larger or equal to off. This enables jumping over a sparse hole to the next compact range of data.

Sourceval iter : t -> (off:Optint.Int63.t -> len:int -> unit) -> (unit, Errs.t) Stdlib.result

iter t f calls f on each (off,len) pair in mapping. Only used for testing and debugging.

It is guaranteed for the offsets to be iterated in monotonic order.

It is guaranteed that entries don't overlap.

The exceptions raised by f are caught and returned (as long as they are known by Errs).

Sourcemodule Wo : sig ... end
Sourcemodule Ao : sig ... end
OCaml

Innovation. Community. Security.