package irmin-pack

  1. Overview
  2. Docs
Irmin backend which stores values in a pack file

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.3.1.tbz
sha256=535254ca443858bfc9e540535977fed63e9206d4b78c5cac0239d1e6657b5c78
sha512=fa18557fcf808121a0495de707c6f7bff4a69197b310480816648adafd4a659b5673a1f5bbf4574f517b7d93253735ef7798b0c365d87afac60675007ef19b54

doc/irmin-pack.unix/Irmin_pack_unix/Checks/Make/argument-1-_/Snapshot/index.html

Module _.Snapshot

type kinded_hash =
  1. | Contents of hash * metadata
  2. | Node of hash
val kinded_hash_t : kinded_hash Irmin.Type.t
type entry = {
  1. step : string;
  2. hash : kinded_hash;
}
val entry_t : entry Irmin.Type.t
type inode_tree = {
  1. depth : int;
  2. length : int;
  3. pointers : (int * hash) list;
}
val inode_tree_t : inode_tree Irmin.Type.t
type v =
  1. | Inode_tree of inode_tree
  2. | Inode_value of entry list
val v_t : v Irmin.Type.t
type inode = {
  1. v : v;
  2. root : bool;
}
val inode_t : inode Irmin.Type.t
type t =
  1. | Inode of inode
  2. | Blob of Backend.Contents.Val.t
val t : t Irmin.Type.t
val export : ?on_disk:[ `Path of string ] -> repo -> (t -> unit Lwt.t) -> root_key:Tree.kinded_key -> int Lwt.t

export ?on_disk repo f ~root_key applies f to all inodes and contents in a rooted tree, with root specified by root_key.

The traversal requires an index to keep track of visited elements.

  • if on_disk is not specified, the index is in memory.
  • if on_disk is `Path path, a temporary index is created at path.

The traversal order is stable. In Inode_tree, it is lexicographic on the index function (see Conf.inode_child_order). In Inode_value, it is lexicographic on the steps.

f is called in post-order, that is f is first called on the leaves, and the last call to f is on the root designated by root_key.

The traversal skips objects that are structurally equal to objects that were already traversed. In other words, export internally uses a hash set in order to guarantee that all the objects passed to f don't hash the same way.

Returns the total number of elements visited.

module Import : sig ... end
OCaml

Innovation. Community. Security.