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/octez-internal-libs.irmin_pack/Irmin_pack/Pack_value/index.html

Module Irmin_pack.Pack_valueSource

This module defines abstractions over entries in the pack file, which are encoded as follows:

  ┌────────┬────────┬──────────────┬─────────┐
  │  Hash  │  Kind  │  Len(Value)? │  Value  │
  └────────┴────────┴──────────────┴─────────┘
  ┆<┄ H ┄┄>┆<┄ K ┄┄>┆<┄┄┄┄ L? ┄┄┄┄>┆<┄┄ V ┄┄>┆
  ┆<┄┄┄┄┄┄┄┄┄┄┄ entry length, E ┄┄┄┄┄┄┄┄┄┄┄┄>┆

The fields are as follows:

  • Hash: the (fixed-length) hash of the data stored in this entry;
  • Kind: the kind of data being stored (contents, nodes, commits etc.), encoded as a single "magic" character;
  • Len(Value): an optional length header for the Value section of the entry (not including the length of the length header itself), encoded using a variable-length encoding (LEB128). The presence of a length header is determined by the Kind character.
  • Value: the data itself.

The length of the overall pack entry, as referenced in the Pack_index or in a direct Pack_key.t, is equal to E = H + K + L + V.

Sourcemodule Kind : sig ... end
Sourcetype nonrec weight =
  1. | Immediate of int
  2. | Deferred of unit -> int
Sourcetype nonrec kinded = ..

kinded is an extenisble variant that each S extends so that it can define S.to_kinded and S.of_kinded. Its purpose is to allow containers, such as Irmin_pack_unix.Lru, to store and return all types of S and thus be usable by modules defined over S, such as Irmin_pack_unix.Pack_store.

Sourcemodule type S = sig ... end
Sourcemodule type Config = sig ... end
Sourcemodule Of_contents (_ : Config) (Hash : Irmin.Hash.S) (Key : sig ... end) (Contents : Irmin.Contents.S) : S with type t = Contents.t and type hash = Hash.t and type key = Key.t
Sourcemodule Of_commit (Hash : Irmin.Hash.S) (Key : Irmin.Key.S with type hash = Hash.t) (Commit : Irmin.Commit.Generic_key.S with type node_key = Key.t and type commit_key = Key.t) : sig ... end
OCaml

Innovation. Community. Security.