package irmin-pack
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=11fc2570bdbfd48478c89113fc801084a84a9a2c12d9bf8c64e05ce64ae19bd7
sha512=2171699ca24dec5c9c908a2676b272e034c14eb17f7052a794535e52af0be40be68a689e59c0a640ee244b11703320483f4d0c261542e6242ba23a8f1272b9b0
doc/irmin-pack.mem/Irmin_pack_mem/Maker/Make/Backend/Commit/index.html
Module Backend.Commit
A commit store.
Commit Store
Read-only stores
Read-only stores are store where it is only possible to read existing values.
type key = commit_keyThe type for keys.
find t k is Some v if k is associated to v in t and None is k is not present in t.
close t frees up all the resources associated with t. Any operations run on a closed handle will raise Closed.
type hash = Hash.tThe type of hashes of value.
Write the contents of a value to the store, and obtain its key.
Same as add but allows specifying the value's hash directly. The backend might choose to discard that hash and/or can be corrupt if the hash is not consistent.
Indexing maps the hash of a value to a corresponding key of that value in the store. For stores that are addressed by hashes directly, this is typically fun _t h -> Lwt.return (Key.of_hash h); for stores with more complex addressing schemes, index may attempt a lookup operation in the store.
In general, indexing is best-effort and reveals no information about the membership of the value in the store. In particular:
index t hash = Some keydoesn't guaranteemem t key: the value with hashhashmay still be absent from the store;
index t hash = Nonedoesn't guarantee that there is nokeysuch thatmem t keyandKey.to_hash key = hash: the value may still be present in the store under a key that is not indexed.
val batch :
Irmin__.Import.read t ->
([ Irmin__.Import.read | Irmin__.Import.write ] t -> 'a Lwt.t) ->
'a Lwt.tbatch t f applies the writes in f in a separate batch. The exact guarantees depend on the implementation.
module Key : sig ... endmodule Info = Schema.InfoCommit info.
module Val : sig ... endVal provides functions for commit values.
module Hash : sig ... endmodule Node : sig ... endNode is the underlying node store.