package git
Module Index_pack.LazySource
The functor to make the lazy decoder of the IDX file. Internally, we use a Cstruct.t representation of the IDX file notified to the make function. This Cstruct.t should never change by the client. All processes available in this module read only the content.
By lazy, we mean that we don't try to make an OCaml value which contains all binded values available in the IDX file - and, by this way, we don't process entirely the file. We read values only when the client ask to get these values - call by need. Use this decoder with the syscall mmap to get the expected Cstruct.t could be useful when mmap do a lazy read.
Parameters
module Hash : sig ... endSignature
type error = | Invalid_header of string(*Appear when the header of the IDX file is incorrect.
*)| Invalid_version of int32(*Appear when the version of the IDX file is wrong.
*)| Invalid_index(*Appear when we try to read an area outside the IDX file.
*)| Expected_bigoffset_table(*Appear when we try to read a big offset table and we can't catch it.
*)| Invalid_bigoffset_index of int(*Appear when we try to read a big offset value and we can't catch it.
*)
The type error.
State of the IDX lzy decoder.
find t hash get the CRC-32 checksum and the absolute offset binded on hash in the IDX file represented by t only if hash exists. Otherwise, it returns None.
mem t hash returns true if hash exists in the IDX file represented by t. Otherwise, it returns false.
Iteration in the IDX file.
Fold in the IDX file.