Legend:
Library
Module
Module type
Parameter
Class
Class type
Managing store's trees.
Tree provides immutable, in-memory partial mirror of the store, with lazy reads and delayed writes.
Trees are like staging area in Git: they are immutable temporary non-persistent areas (they disappear if the host crash), held in memory for efficiency, where reads are done lazily and writes are done only when needed on commit: if you modify a key twice, only the last change will be written to the store when you commit.
empty is the empty tree. The empty tree does not have associated backend configuration values, as they can perform in-memory operation, independently of any given backend.
pruned h is a purely in-memory tree with the hash h. Such trees can be used as children of other in-memory tree nodes, for instance in order to compute the hash of the parent, but they cannot be dereferenced.
Any operation that would require loading the contents of a pruned node (e.g. calling find on one of its children) will instead raise a Pruned_hash exception. Attempting to export a tree containing pruned sub-trees to a repository will fail similarly.
val kind : tree->key->[ `Contents | `Node ] optionLwt.t
kind t k is the type of s in t. It could either be a tree node or some file contents. It is None if k is not present in t.
The type for fold's force parameter. `True forces the fold to read the objects of the lazy nodes and contents. `False f is applying f on every lazy node and content value instead.
The type for fold's uniq parameters. `False folds over all the nodes. `True does not recurse on nodes already seen. `Marks m uses the collection of marks m to store the cache of keys: the fold will modify m. This can be used for incremental folds.
val fold :
?order:[ `Sorted | `Undefined| `Random of Stdlib.Random.State.t ]->?force:'aforce->?cache:bool ->?uniq:uniq->?pre:'anode_fn->?post:'anode_fn->?depth:depth->?contents:(key->contents->'a->'aLwt.t)->?node:(key->node->'a->'aLwt.t)->?tree:(key->tree->'a->'aLwt.t)->tree->'a->'aLwt.t
fold f t acc folds f over t's leafs.
For every node n, ui n is a leaf node, call f path n. Otherwise:
Call pre path n. By default pre is the identity;
Recursively call fold on each children.
Call post path n; By default post is the identity.
See force for details about the force parameters. By default it is `True.
See uniq for details about the uniq parameters. By default it is `False.
The fold depth is controlled by the depth parameter.
cache defaults to false, see caching for an explanation of the parameter.
If order is `Sorted (the default), the elements are traversed in lexicographic order of their keys. If `Random state, they are traversed in a random order. For large nodes, these two modes are memory-consuming, use `Undefined for a more memory efficient fold.
Hashes in the Irmin store are tagged with the type of the value they reference (either contents or node). In the contents case, the hash is paired with corresponding metadata.