Brassaia_pack.Pack_valueThis 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.
module Kind : sig ... endkinded 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 Brassaia_pack_unix.Lru, to store and return all types of S and thus be usable by modules defined over S, such as Brassaia_pack_unix.Pack_store.
module type S = sig ... endmodule type Config = sig ... endmodule Of_contents
(_ : Config)
(Hash : Brassaia.Hash.S)
(Key : sig ... end)
(Contents : Brassaia.Contents.S) :
S with type t = Contents.t and type hash = Hash.t and type key = Key.tmodule Of_commit
(Hash : Brassaia.Hash.S)
(Key : Brassaia.Key.S with type hash = Hash.t)
(Commit :
Brassaia.Commit.Generic_key.S
with type node_key = Key.t
and type commit_key = Key.t) :
sig ... end