package octez-internal-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/irmin_pack_unix/Irmin_pack_unix/Maker/Make/Snapshot/index.html
Module Make.SnapshotSource
val kinded_hash_t : kinded_hash Irmin.Type.tval entry_t : entry Irmin.Type.tval inode_tree_t : inode_tree Irmin.Type.tval v_t : v Irmin.Type.tval inode_t : inode Irmin.Type.tval export :
?on_disk:[ `Path of string ] ->
repo ->
(t -> unit Lwt.t) ->
root_key:Tree.kinded_key ->
int Lwt.texport ?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_diskis not specified, the index is in memory. - if
on_diskis`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.